Commit a9628c9b authored by Thong Kuah's avatar Thong Kuah

Set const_get to not inherit scope

Fix the one constant passed into BackgroundMigration which was fully
qualified.
parent 418dbb87
......@@ -77,11 +77,9 @@ module Gitlab
enqueued_job?([retry_set], migration_class)
end
# rubocop:disable Cop/ConstGetInheritFalse
def self.migration_class_for(class_name)
const_get(class_name)
const_get(class_name, false)
end
# rubocop:enable Cop/ConstGetInheritFalse
def self.enqueued_job?(queues, migration_class)
queues.each do |queue|
......
......@@ -171,7 +171,11 @@ module Gitlab
end
def schedule_retry(project, retry_count)
BackgroundMigrationWorker.perform_in(RETRY_DELAY, self.class::RetryOne.name, [project.id, retry_count])
# Constants provided to BackgroundMigrationWorker must be within the
# scope of Gitlab::BackgroundMigration
retry_class_name = self.class::RetryOne.name.sub('Gitlab::BackgroundMigration::', '')
BackgroundMigrationWorker.perform_in(RETRY_DELAY, retry_class_name, [project.id, retry_count])
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment