2021-04-29 21:17:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class DropPipelineWorker
|
|
|
|
include ApplicationWorker
|
2021-06-08 01:23:25 +05:30
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2021-04-29 21:17:54 +05:30
|
|
|
include PipelineQueue
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
tags :exclude_from_kubernetes
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
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
|