2021-09-30 23:02:18 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class ArchiveTraceWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2022-08-13 15:12:31 +05:30
|
|
|
data_consistency :sticky
|
2021-10-27 15:23:28 +05:30
|
|
|
|
2021-09-30 23:02:18 +05:30
|
|
|
sidekiq_options retry: 3
|
|
|
|
include PipelineBackgroundQueue
|
|
|
|
|
|
|
|
def perform(job_id)
|
2022-08-13 15:12:31 +05:30
|
|
|
archivable_jobs = Ci::Build.without_archived_trace.eager_load_for_archiving_trace
|
2022-07-23 23:45:48 +05:30
|
|
|
|
|
|
|
archivable_jobs.find_by_id(job_id).try do |job|
|
2021-09-30 23:02:18 +05:30
|
|
|
Ci::ArchiveTraceService.new.execute(job, worker_name: self.class.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|