summaryrefslogtreecommitdiff
path: root/app/workers/pipeline_notification_worker.rb
blob: e4a18573d20eea32c23d4aa1e07880d1da6d50ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

class PipelineNotificationWorker
  include ApplicationWorker
  include PipelineQueue

  # rubocop: disable CodeReuse/ActiveRecord
  def perform(pipeline_id, recipients = nil)
    pipeline = Ci::Pipeline.find_by(id: pipeline_id)

    return unless pipeline

    NotificationService.new.pipeline_finished(pipeline, recipients)
  end
  # rubocop: enable CodeReuse/ActiveRecord
end