diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-21 10:39:02 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-21 10:39:02 +0000 |
commit | 2f0a2e99f18838e53f9a7946aaaf656e11c2ef4f (patch) | |
tree | e21baf9d238dd0553788a4c9749bee07d365a272 /db | |
parent | f592cae12992f86d711973a82296abfd7bf05bc4 (diff) | |
parent | ca0d84384dd3ea6d9d3b9a365ab84e5f25276524 (diff) | |
download | gitlab-ce-2f0a2e99f18838e53f9a7946aaaf656e11c2ef4f.tar.gz |
Merge branch 'dz-improve-rename-projects-migration' into 'master'
Improve rename projects migration
Closes #29556
See merge request !10009
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170313133418_rename_more_reserved_project_names.rb | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb b/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb index 9dfe77bedb7..44c688fa134 100644 --- a/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb +++ b/db/post_migrate/20170313133418_rename_more_reserved_project_names.rb @@ -6,41 +6,12 @@ class RenameMoreReservedProjectNames < ActiveRecord::Migration DOWNTIME = false - THREAD_COUNT = 8 - KNOWN_PATHS = %w(artifacts graphs refs badges).freeze def up - queues = Array.new(THREAD_COUNT) { Queue.new } - start = false - - threads = Array.new(THREAD_COUNT) do |index| - Thread.new do - queue = queues[index] - - # Wait until we have input to process. - until start; end - - rename_projects(queue.pop) until queue.empty? - end - end - - enum = queues.each - reserved_projects.each_slice(100) do |slice| - begin - queue = enum.next - rescue StopIteration - enum.rewind - retry - end - - queue << slice + rename_projects(slice) end - - start = true - - threads.each(&:join) end def down |