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

module Ci
  class CreateCrossProjectPipelineWorker # rubocop:disable Scalability/IdempotentWorker
    include ::ApplicationWorker
    include ::PipelineQueue

    worker_resource_boundary :cpu

    def perform(bridge_id)
      ::Ci::Bridge.find_by_id(bridge_id).try do |bridge|
        ::Ci::CreateDownstreamPipelineService
          .new(bridge.project, bridge.user)
          .execute(bridge)
      end
    end
  end
end