summaryrefslogtreecommitdiff
path: root/app/workers/pipeline_success_worker.rb
blob: 2ab0739a17f5e02a93bbc23bdf5def208e81a5e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class PipelineSuccessWorker
  include ApplicationWorker
  include PipelineQueue

  queue_namespace :pipeline_processing

  def perform(pipeline_id)
    Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline|
      MergeRequests::MergeWhenPipelineSucceedsService
        .new(pipeline.project, nil)
        .trigger(pipeline)
    end
  end
end