gitlab-org--gitlab-foss/app/workers/build_finished_worker.rb

23 lines
753 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class BuildFinishedWorker
include ApplicationWorker
include PipelineQueue
2017-11-28 11:16:50 -05:00
queue_namespace :pipeline_processing
# rubocop: disable CodeReuse/ActiveRecord
def perform(build_id)
Ci::Build.find_by(id: build_id).try do |build|
# We execute that in sync as this access the files in order to access local file, and reduce IO
BuildTraceSectionsWorker.new.perform(build.id)
BuildCoverageWorker.new.perform(build.id)
2018-11-15 05:15:03 -05:00
# We execute that async as this are two independent operations that can be executed after TraceSections and Coverage
BuildHooksWorker.perform_async(build.id)
ArchiveTraceWorker.perform_async(build.id)
end
end
# rubocop: enable CodeReuse/ActiveRecord
end