Commit 14ec3adf authored by Shinya Maeda's avatar Shinya Maeda

Use w+b mode when Trace#set

parent 908aad0a
...@@ -36,7 +36,7 @@ module Gitlab ...@@ -36,7 +36,7 @@ module Gitlab
end end
def set(data) def set(data)
write do |stream| write('w+b') do |stream|
data = job.hide_secrets(data) data = job.hide_secrets(data)
stream.set(data) stream.set(data)
end end
...@@ -75,14 +75,14 @@ module Gitlab ...@@ -75,14 +75,14 @@ module Gitlab
stream&.close stream&.close
end end
def write def write(mode = 'a+b')
stream = Gitlab::Ci::Trace::Stream.new do stream = Gitlab::Ci::Trace::Stream.new do
if current_path if current_path
current_path File.open(current_path, mode)
elsif Feature.enabled?('ci_enable_live_trace') elsif Feature.enabled?('ci_enable_live_trace')
Gitlab::Ci::Trace::ChunkedIO.new(job) Gitlab::Ci::Trace::ChunkedIO.new(job)
else else
File.open(ensure_path, "a+b") File.open(ensure_path, mode)
end end
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