Fixes timeout when adding an SSH key
Users with many projects (>100) will hit the 20 second timeout when updating the gitolite config. This fix batches those changes into a signle update to the file, causing an order of magnitude speed increase which finishes well below the 20 second timeout. Fixes gitlabhq/gitlabhq#220
This commit is contained in:
parent
6d5c969872
commit
8a1deea586
2 changed files with 30 additions and 8 deletions
|
@ -21,20 +21,14 @@ class Key < ActiveRecord::Base
|
|||
def update_repository
|
||||
Gitlabhq::GitHost.system.new.configure do |c|
|
||||
c.update_keys(identifier, key)
|
||||
|
||||
projects.each do |project|
|
||||
c.update_project(project.path, project)
|
||||
end
|
||||
c.update_projects(projects)
|
||||
end
|
||||
end
|
||||
|
||||
def repository_delete_key
|
||||
Gitlabhq::GitHost.system.new.configure do |c|
|
||||
c.delete_key(identifier)
|
||||
|
||||
projects.each do |project|
|
||||
c.update_project(project.path, project)
|
||||
end
|
||||
c.update_projects(projects)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue