diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-11 16:42:00 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-11 16:42:00 +0300 |
commit | 388abbd10c043b4cc406fa717e05dd81b0858c02 (patch) | |
tree | 8fa0aebe2a67d5efcf9d1227dbc3d3d8b8228e46 /lib/gitlab/background_migration.rb | |
parent | c17b1d5f5651b6f73b8c999bb6a5376e31a7d30d (diff) |
Extract background migratons queue class method
Diffstat (limited to 'lib/gitlab/background_migration.rb')
-rw-r--r-- | lib/gitlab/background_migration.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/background_migration.rb b/lib/gitlab/background_migration.rb index d95ecd7b291..6ddffe70da4 100644 --- a/lib/gitlab/background_migration.rb +++ b/lib/gitlab/background_migration.rb @@ -1,12 +1,15 @@ module Gitlab module BackgroundMigration + def self.queue + BackgroundMigrationWorker.sidekiq_options['queue'] + end + # Begins stealing jobs from the background migrations queue, blocking the # caller until all jobs have been completed. # # steal_class - The name of the class for which to steal jobs. def self.steal(steal_class) - queue = Sidekiq::Queue - .new(BackgroundMigrationWorker.sidekiq_options['queue']) + queue = Sidekiq::Queue.new(self.queue) queue.each do |job| migration_class, migration_args = job.args |