2021-03-08 18:12:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module JiraConnect
|
2021-09-30 23:02:18 +05:30
|
|
|
class SyncDeploymentsWorker # rubocop:disable Scalability/IdempotentWorker
|
2021-03-08 18:12:59 +05:30
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
sidekiq_options retry: 3
|
2021-03-08 18:12:59 +05:30
|
|
|
queue_namespace :jira_connect
|
|
|
|
feature_category :integrations
|
2021-09-30 23:02:18 +05:30
|
|
|
data_consistency :delayed
|
2021-06-08 01:23:25 +05:30
|
|
|
tags :exclude_from_kubernetes
|
2021-10-27 15:23:28 +05:30
|
|
|
urgency :low
|
2021-03-08 18:12:59 +05:30
|
|
|
|
2021-09-30 23:02:18 +05:30
|
|
|
worker_has_external_dependencies!
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
def perform(deployment_id, sequence_id)
|
|
|
|
deployment = Deployment.find_by_id(deployment_id)
|
|
|
|
|
|
|
|
return unless deployment
|
|
|
|
|
|
|
|
::JiraConnect::SyncService
|
|
|
|
.new(deployment.project)
|
|
|
|
.execute(deployments: [deployment], update_sequence_id: sequence_id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.perform_async(id)
|
|
|
|
seq_id = ::Atlassian::JiraConnect::Client.generate_update_sequence_id
|
|
|
|
super(id, seq_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|