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