2020-08-07 18:09:53 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class PagesUpdateConfigurationWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
|
|
|
|
2021-04-30 18:10:09 +00:00
|
|
|
sidekiq_options retry: 3
|
|
|
|
|
2020-08-07 18:09:53 +00:00
|
|
|
idempotent!
|
|
|
|
feature_category :pages
|
|
|
|
|
2021-02-23 18:10:40 +00:00
|
|
|
def self.perform_async(*args)
|
2021-04-06 12:09:21 +00:00
|
|
|
return unless ::Settings.pages.local_store.enabled
|
2021-02-23 18:10:40 +00:00
|
|
|
|
|
|
|
super(*args)
|
|
|
|
end
|
|
|
|
|
2020-08-07 18:09:53 +00:00
|
|
|
def perform(project_id)
|
|
|
|
project = Project.find_by_id(project_id)
|
|
|
|
return unless project
|
|
|
|
|
2020-08-25 12:04:30 +00:00
|
|
|
Projects::UpdatePagesConfigurationService.new(project).execute
|
2020-08-07 18:09:53 +00:00
|
|
|
end
|
|
|
|
end
|