|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class BackgroundMigrationWorker
|
|
|
|
class BackgroundMigrationWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
|
|
|
feature_category_not_owned!
|
| ... | ... | @@ -22,6 +22,7 @@ class BackgroundMigrationWorker |
|
|
|
# class_name - The class name of the background migration to run.
|
|
|
|
# arguments - The arguments to pass to the migration class.
|
|
|
|
def perform(class_name, arguments = [])
|
|
|
|
with_context(caller_id: class_name.to_s) do
|
|
|
|
should_perform, ttl = perform_and_ttl(class_name)
|
|
|
|
|
|
|
|
if should_perform
|
| ... | ... | @@ -35,6 +36,7 @@ class BackgroundMigrationWorker |
|
|
|
.perform_in(ttl || self.class.minimum_interval, class_name, arguments)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def perform_and_ttl(class_name)
|
|
|
|
if always_perform?
|
| ... | ... | |
| ... | ... | |