2021-01-13 12:10:27 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module JiraConnect
|
2021-07-09 18:09:51 +00:00
|
|
|
class SyncFeatureFlagsWorker # rubocop:disable Scalability/IdempotentWorker
|
2021-01-13 12:10:27 +00:00
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-04-30 18:10:09 +00:00
|
|
|
sidekiq_options retry: 3
|
2021-01-13 12:10:27 +00:00
|
|
|
queue_namespace :jira_connect
|
|
|
|
feature_category :integrations
|
2021-07-19 12:10:08 +00:00
|
|
|
data_consistency :delayed
|
2021-07-26 18:09:51 +00:00
|
|
|
urgency :low
|
2021-01-13 12:10:27 +00:00
|
|
|
|
2021-07-09 18:09:51 +00:00
|
|
|
worker_has_external_dependencies!
|
|
|
|
|
2021-01-13 12:10:27 +00:00
|
|
|
def perform(feature_flag_id, sequence_id)
|
|
|
|
feature_flag = ::Operations::FeatureFlag.find_by_id(feature_flag_id)
|
|
|
|
|
|
|
|
return unless feature_flag
|
|
|
|
|
|
|
|
::JiraConnect::SyncService
|
|
|
|
.new(feature_flag.project)
|
|
|
|
.execute(feature_flags: [feature_flag], update_sequence_id: sequence_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|