blob: 9f5ff45b8a6597375160839d63fe198998d0081d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# frozen_string_literal: true
module Ci
class CreateDownstreamPipelineWorker # rubocop:disable Scalability/IdempotentWorker
include ::ApplicationWorker
include ::PipelineQueue
sidekiq_options retry: 3
worker_resource_boundary :cpu
urgency :high
def perform(bridge_id)
::Ci::Bridge.find_by_id(bridge_id).try do |bridge|
result = ::Ci::CreateDownstreamPipelineService
.new(bridge.project, bridge.user)
.execute(bridge)
if result.success?
log_extra_metadata_on_done(:new_pipeline_id, result.payload.id)
else
log_extra_metadata_on_done(:create_error_message, result.message)
end
end
end
end
end
|