diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-07-06 12:21:40 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-07-06 12:21:40 +0300 |
commit | 68d138e85e3263959700d16eab7d9ab3e883f7f8 (patch) | |
tree | 5fa92f32197e300937330f4cbc5acb34bee4a847 /app | |
parent | 82f6b4b0ab17d70d1ff291e2e4e114655ef255ae (diff) | |
parent | f60ffd542244b6627dc1dc39ff15e12c70434a45 (diff) |
Merge branch 'remove-trace-efficiently' into 'master'
Remove redundant query when removing trace
See merge request gitlab-org/gitlab-ce!20324
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/build.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index bf93a2caf72..19949f83351 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -386,6 +386,10 @@ module Ci trace.exist? end + def has_old_trace? + old_trace.present? + end + def trace=(data) raise NotImplementedError end @@ -395,6 +399,8 @@ module Ci end def erase_old_trace! + return unless has_old_trace? + update_column(:trace, nil) end |