2021-07-13 11:08:38 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class ArchiveTraceWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2022-07-09 02:08:43 -04:00
|
|
|
data_consistency :sticky
|
2021-07-21 08:09:35 -04:00
|
|
|
|
2021-07-13 11:08:38 -04:00
|
|
|
sidekiq_options retry: 3
|
|
|
|
include PipelineBackgroundQueue
|
|
|
|
|
|
|
|
def perform(job_id)
|
2022-07-09 02:08:43 -04:00
|
|
|
archivable_jobs = Ci::Build.without_archived_trace.eager_load_for_archiving_trace
|
2022-05-18 17:07:37 -04:00
|
|
|
|
|
|
|
archivable_jobs.find_by_id(job_id).try do |job|
|
2021-07-13 11:08:38 -04:00
|
|
|
Ci::ArchiveTraceService.new.execute(job, worker_name: self.class.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|