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

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

# Worker for tracking exit codes of failed CI jobs
module Ci
  class TrackFailedBuildWorker # rubocop:disable Scalability/IdempotentWorker
    include ApplicationWorker
    include PipelineBackgroundQueue

    feature_category :static_application_security_testing

    urgency :low
    data_consistency :sticky
    worker_resource_boundary :cpu
    idempotent!
    worker_has_external_dependencies!

    def perform(build_id, exit_code, failure_reason)
      ::Ci::Build.find_by_id(build_id).try do |build|
        ::Ci::TrackFailedBuildService.new(
          build: build,
          exit_code: exit_code,
          failure_reason: failure_reason).execute
      end
    end
  end
end