summaryrefslogtreecommitdiff
path: root/app/models/ci/build.rb
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-10-27 17:05:02 +0200
committerTomasz Maczukin <tomasz@maczukin.pl>2016-11-15 13:54:47 +0100
commit4dab79c5c6aa1eed1295663fe91c62ea0062f8d2 (patch)
tree2af95bb0669bed87a5a95f1fca9a38a2ff2f48cd /app/models/ci/build.rb
parentb3616e3074202d63a4ed03bbe94b14a4488c7800 (diff)
downloadgitlab-ce-4dab79c5c6aa1eed1295663fe91c62ea0062f8d2.tar.gz
Update the updated_at of a build while patching the trace
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r--app/models/ci/build.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index bf5f92f8462..33612256540 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -271,6 +271,7 @@ module Ci
def append_trace(trace_part, offset)
recreate_trace_dir
+ touch if needs_touch?
trace_part = hide_secrets(trace_part)
@@ -280,6 +281,10 @@ module Ci
end
end
+ def needs_touch?
+ Time.now - updated_at > 15.minutes.to_i
+ end
+
def trace_file_path
if has_old_trace_file?
old_path_to_trace