diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-03-21 13:39:02 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-03-21 17:36:03 +0300 |
commit | 2d2a9e7ab2e1da57ef4d73a04055aada917c8386 (patch) | |
tree | 66cdccd0d1c2de1c44277209e14b70115d744828 /db | |
parent | dcb55f3e936e4da4a067e5f86d18f3bb5ad8f0c0 (diff) |
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 |