Commit 9bf810a9 authored by Shinya Maeda's avatar Shinya Maeda

Catch ArchiveError and ignore errors if it's already archived

parent 116955c4
...@@ -12,7 +12,9 @@ module Ci ...@@ -12,7 +12,9 @@ module Ci
Ci::Build.finished.with_live_trace.find_each(batch_size: 100) do |build| Ci::Build.finished.with_live_trace.find_each(batch_size: 100) do |build|
begin begin
build.trace.archive! build.trace.archive!
rescue => e rescue ArchiveError => e
next if e.message.include?('Already archived')
failed_archive_counter.increment failed_archive_counter.increment
Rails.logger.error "Failed to archive stale live trace. id: #{build.id} message: #{e.message}" Rails.logger.error "Failed to archive stale live trace. id: #{build.id} message: #{e.message}"
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment