From 32e32fa0fd45ef091fe4c4639313c3e281bfc5df Mon Sep 17 00:00:00 2001 From: Paco Guzman Date: Thu, 29 Sep 2016 12:59:31 +0200 Subject: [PATCH] Revert to use Mounter method to check existence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See: https://gitlab.com/gitlab-org/gitlab-ce/commit/6280fd3777920670ee42111fddf29576cbf85988#note_14766241 We wanted to avoid accesses to the file system, because it seems reasonable that if the mounter column has some content it’s because there are an associate file. This is an speed boost when you access to a bunch of build instances to show their information. The problem is that solution doesn’t work if you uses that method to detect the thing and you’re changing the uploaded file on instances that had that column empty. Until you don’t persist the instance the database column will be empty so we can have false negatives --- CHANGELOG | 1 + app/models/ci/build.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b4368c2cf9e..7f3111bfd44 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ v 8.13.0 (unreleased) - Only update issuable labels if they have been changed - Revoke button in Applications Settings underlines on hover. - Fix Long commit messages overflow viewport in file tree + - Revert avoid touching file system on Build#artifacts? - Update ruby-prof to 0.16.2. !6026 (Elan Ruusamäe) - Add organization field to user profile - Fix resolved discussion display in side-by-side diff view !6575 diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 522e2264bb8..5dbf66173de 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -373,7 +373,7 @@ module Ci end def artifacts? - !artifacts_expired? && self[:artifacts_file].present? + !artifacts_expired? && artifacts_file.exists? end def artifacts_metadata?