From 4dab79c5c6aa1eed1295663fe91c62ea0062f8d2 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Thu, 27 Oct 2016 17:05:02 +0200 Subject: Update the updated_at of a build while patching the trace --- app/models/ci/build.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/models/ci/build.rb') 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 -- cgit v1.2.1