build_finished_worker.rb 635 Bytes
Newer Older
1
class BuildFinishedWorker
2
  include ApplicationWorker
3 4
  include PipelineQueue

5
  queue_namespace :pipeline_processing
6 7 8

  def perform(build_id)
    Ci::Build.find_by(id: build_id).try do |build|
9 10 11 12 13
      # 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)

      # We execute that async as this are two indepentent operations that can be executed after TraceSections and Coverage
14
      BuildHooksWorker.perform_async(build.id)
15
      ArchiveTraceWorker.perform_async(build.id)
16 17 18
    end
  end
end