diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-29 16:30:17 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-12-05 11:59:39 +0100 |
commit | 1e6ca3c41ead23c5e433460c8c807ea73d9ec0ef (patch) | |
tree | ed6a5da0def848adc1a15f80e69d9c55651895a4 /app/workers/background_migration_worker.rb | |
parent | a5c3f1c8ff7da20183b172b2b0693a6010c9e86d (diff) | |
download | gitlab-ce-1e6ca3c41ead23c5e433460c8c807ea73d9ec0ef.tar.gz |
Consistently schedule Sidekiq jobsdm-application-worker
Diffstat (limited to 'app/workers/background_migration_worker.rb')
-rw-r--r-- | app/workers/background_migration_worker.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/app/workers/background_migration_worker.rb b/app/workers/background_migration_worker.rb index 65791c4eaba..aeb3bc019b9 100644 --- a/app/workers/background_migration_worker.rb +++ b/app/workers/background_migration_worker.rb @@ -1,34 +1,6 @@ class BackgroundMigrationWorker include ApplicationWorker - # Enqueues a number of jobs in bulk. - # - # The `jobs` argument should be an Array of Arrays, each sub-array must be in - # the form: - # - # [migration-class, [arg1, arg2, ...]] - def self.perform_bulk(jobs) - Sidekiq::Client.push_bulk('class' => self, - 'queue' => sidekiq_options['queue'], - 'args' => jobs) - end - - # Schedules multiple jobs in bulk, with a delay. - # - def self.perform_bulk_in(delay, jobs) - now = Time.now.to_i - schedule = now + delay.to_i - - if schedule <= now - raise ArgumentError, 'The schedule time must be in the future!' - end - - Sidekiq::Client.push_bulk('class' => self, - 'queue' => sidekiq_options['queue'], - 'args' => jobs, - 'at' => schedule) - end - # Performs the background migration. # # See Gitlab::BackgroundMigration.perform for more information. |