diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-07-02 10:18:16 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-07-05 04:52:50 +0300 |
commit | 9bf810a9f85343993d2767b2f81185b24049b5e4 (patch) | |
tree | ae4182faaae0ea1f5ec1aa68790e5f17b8cab61a /app | |
parent | 116955c4533497e68abbddbace2eae0a07c98569 (diff) |
Catch ArchiveError and ignore errors if it's already archived
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/ci/archive_traces_cron_worker.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/workers/ci/archive_traces_cron_worker.rb b/app/workers/ci/archive_traces_cron_worker.rb index 7016edde698..9bee4fe6cc5 100644 --- a/app/workers/ci/archive_traces_cron_worker.rb +++ b/app/workers/ci/archive_traces_cron_worker.rb @@ -12,7 +12,9 @@ module Ci Ci::Build.finished.with_live_trace.find_each(batch_size: 100) do |build| begin build.trace.archive! - rescue => e + rescue ArchiveError => e + next if e.message.include?('Already archived') + failed_archive_counter.increment Rails.logger.error "Failed to archive stale live trace. id: #{build.id} message: #{e.message}" end |