Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/background_migration/job_coordinator.rb')
-rw-r--r--lib/gitlab/background_migration/job_coordinator.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/gitlab/background_migration/job_coordinator.rb b/lib/gitlab/background_migration/job_coordinator.rb
index cfbe7167677..5dc77f935e3 100644
--- a/lib/gitlab/background_migration/job_coordinator.rb
+++ b/lib/gitlab/background_migration/job_coordinator.rb
@@ -36,6 +36,8 @@ module Gitlab
attr_reader :worker_class
+ delegate :minimum_interval, :perform_in, to: :worker_class
+
def queue
@queue ||= worker_class.sidekiq_options['queue']
end
@@ -79,7 +81,7 @@ module Gitlab
def perform(class_name, arguments)
with_shared_connection do
- migration_class_for(class_name).new.perform(*arguments)
+ migration_instance_for(class_name).perform(*arguments)
end
end
@@ -113,6 +115,16 @@ module Gitlab
enqueued_job?([retry_set], migration_class)
end
+ def migration_instance_for(class_name)
+ migration_class = migration_class_for(class_name)
+
+ if migration_class < Gitlab::BackgroundMigration::BaseJob
+ migration_class.new(connection: connection)
+ else
+ migration_class.new
+ end
+ end
+
def migration_class_for(class_name)
Gitlab::BackgroundMigration.const_get(class_name, false)
end