2021-04-15 14:09:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class DropPipelineWorker
|
|
|
|
include ApplicationWorker
|
2021-04-30 14:10:09 -04:00
|
|
|
|
2021-07-21 08:09:35 -04:00
|
|
|
data_consistency :always
|
|
|
|
|
2021-04-30 14:10:09 -04:00
|
|
|
sidekiq_options retry: 3
|
2021-04-15 14:09:01 -04:00
|
|
|
include PipelineQueue
|
|
|
|
|
|
|
|
idempotent!
|
|
|
|
|
|
|
|
def perform(pipeline_id, failure_reason)
|
|
|
|
Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline|
|
|
|
|
Ci::DropPipelineService.new.execute(pipeline, failure_reason.to_sym)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|