build_finished_worker.rb 766 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
      # Swap all trace chunks to Database from Redis
10
      # TODO: Do we need that?
11
12
13
      build.chunks.redis.map(&:use_database!)

      # We execute that in sync as this access the files in order to access local data, and reduce IO
14
15
16
17
      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
18
      BuildHooksWorker.perform_async(build.id)
19
      ArchiveTraceWorker.perform_async(build.id)
20
21
22
    end
  end
end