summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-09-29 12:59:31 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-09-30 09:35:58 +0200
commit32e32fa0fd45ef091fe4c4639313c3e281bfc5df (patch)
treecad09e6f850d297499315ac3316579114e96cbf0
parent80fef70bb7c9c1cab1ff80e78f94a83d6712e50d (diff)
downloadgitlab-ce-22768-revert-to-touch-file-system.tar.gz
Revert to use Mounter method to check existence22768-revert-to-touch-file-system
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
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/ci/build.rb2
2 files changed, 2 insertions, 1 deletions
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?