diff options
Diffstat (limited to 'app/services/ci/archive_trace_service.rb')
-rw-r--r-- | app/services/ci/archive_trace_service.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/services/ci/archive_trace_service.rb b/app/services/ci/archive_trace_service.rb index 995b58c6882..17cac38ace2 100644 --- a/app/services/ci/archive_trace_service.rb +++ b/app/services/ci/archive_trace_service.rb @@ -3,10 +3,15 @@ module Ci class ArchiveTraceService def execute(job, worker_name:) + unless job.trace.archival_attempts_available? + Sidekiq.logger.warn(class: worker_name, message: 'The job is out of archival attempts.', job_id: job.id) + + job.trace.attempt_archive_cleanup! + return + end + unless job.trace.can_attempt_archival_now? - Sidekiq.logger.warn(class: worker_name, - message: job.trace.archival_attempts_message, - job_id: job.id) + Sidekiq.logger.warn(class: worker_name, message: 'The job can not be archived right now.', job_id: job.id) return end |