diff options
Diffstat (limited to 'app/workers/ci/drop_pipeline_worker.rb')
-rw-r--r-- | app/workers/ci/drop_pipeline_worker.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/workers/ci/drop_pipeline_worker.rb b/app/workers/ci/drop_pipeline_worker.rb new file mode 100644 index 00000000000..d19157a47e8 --- /dev/null +++ b/app/workers/ci/drop_pipeline_worker.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Ci + class DropPipelineWorker + include ApplicationWorker + 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 |