Class: MergeRequests::UpdateHeadPipelineWorker

Inherits:
Object
  • Object
show all
Includes:
Gitlab::EventStore::Subscriber
Defined in:
app/workers/merge_requests/update_head_pipeline_worker.rb

Instance Method Summary collapse

Methods included from Gitlab::EventStore::Subscriber

#handle_event_in, #perform

Instance Method Details

#handle_event(event) ⇒ Object



14
15
16
17
18
19
20
21
# File 'app/workers/merge_requests/update_head_pipeline_worker.rb', line 14

def handle_event(event)
  pipeline = Ci::Pipeline.in_partition(event.data[:partition_id]).find_by_id(event.data[:pipeline_id])
  return unless pipeline

  pipeline.all_merge_requests.opened.each do |merge_request|
    merge_request.update_head_pipeline
  end
end