Commit 99d5668c authored by Sean Arnold's avatar Sean Arnold

Simply logic in unsafe_archive!

parent a85209d6
...@@ -191,11 +191,7 @@ module Gitlab ...@@ -191,11 +191,7 @@ module Gitlab
def unsafe_archive! def unsafe_archive!
raise ArchiveError, 'Job is not finished yet' unless job.complete? raise ArchiveError, 'Job is not finished yet' unless job.complete?
if trace_artifact unsafe_trace_cleanup!
unsafe_trace_cleanup!
raise AlreadyArchivedError, 'Could not archive again' if already_archived?
end
if job.trace_chunks.any? if job.trace_chunks.any?
Gitlab::Ci::Trace::ChunkedIO.new(job) do |stream| Gitlab::Ci::Trace::ChunkedIO.new(job) do |stream|
...@@ -227,6 +223,7 @@ module Gitlab ...@@ -227,6 +223,7 @@ module Gitlab
if already_archived? if already_archived?
# An archive already exists, so make sure to remove the trace chunks # An archive already exists, so make sure to remove the trace chunks
erase_trace_chunks! erase_trace_chunks!
raise AlreadyArchivedError, 'Could not archive again'
else else
# An archive already exists, but its associated file is not complete, so remove it # An archive already exists, but its associated file is not complete, so remove it
trace_artifact.destroy! trace_artifact.destroy!
......
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