Welcome to mirror list, hosted at ThFree Co, Russian Federation.

initialize_pipelines_iid_sequence_worker.rb « ci « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 95b58814e08973ec40a44752523b6a3d9a368a22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Ci
  class InitializePipelinesIidSequenceWorker
    include Gitlab::EventStore::Subscriber

    data_consistency :always
    feature_category :continuous_integration
    idempotent!

    def handle_event(event)
      Project.find_by_id(event.data[:project_id]).try do |project|
        next if project.internal_ids.ci_pipelines.any?

        ::Ci::Pipeline.track_project_iid!(project, 0)
      end
    end
  end
end