Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-07-04 08:20:37 +0300
committerShinya Maeda <shinya@gitlab.com>2018-07-05 04:52:50 +0300
commit647106fec7db265e555988c949f722b8ee2c00e3 (patch)
treebf78e70c7767b658bfc14cccd64dbce126d837b1 /app/workers
parent9bf810a9f85343993d2767b2f81185b24049b5e4 (diff)
Check if trace exists before process `archive!` method
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/archive_trace_worker.rb2
-rw-r--r--app/workers/ci/archive_traces_cron_worker.rb6
2 files changed, 3 insertions, 5 deletions
diff --git a/app/workers/archive_trace_worker.rb b/app/workers/archive_trace_worker.rb
index 9169f21af2a..bad6a3e2fc7 100644
--- a/app/workers/archive_trace_worker.rb
+++ b/app/workers/archive_trace_worker.rb
@@ -6,7 +6,7 @@ class ArchiveTraceWorker
def perform(job_id)
Ci::Build.find_by(id: job_id).try do |job|
- job.trace.archive!
+ job.trace.archive! unless build.job_artifacts_trace
end
end
end
diff --git a/app/workers/ci/archive_traces_cron_worker.rb b/app/workers/ci/archive_traces_cron_worker.rb
index 9bee4fe6cc5..3fdfefba46d 100644
--- a/app/workers/ci/archive_traces_cron_worker.rb
+++ b/app/workers/ci/archive_traces_cron_worker.rb
@@ -11,10 +11,8 @@ module Ci
# More details in https://gitlab.com/gitlab-org/gitlab-ce/issues/36791
Ci::Build.finished.with_live_trace.find_each(batch_size: 100) do |build|
begin
- build.trace.archive!
- rescue ArchiveError => e
- next if e.message.include?('Already archived')
-
+ build.trace.archive! unless build.job_artifacts_trace
+ rescue => e
failed_archive_counter.increment
Rails.logger.error "Failed to archive stale live trace. id: #{build.id} message: #{e.message}"
end