Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-19 20:01:09 +0300
committerStan Hu <stanhu@gmail.com>2019-07-19 20:03:41 +0300
commitec5ceae623fceff0a959c7d297970d37285532dc (patch)
tree1cf6083ee561298c1c1f5c652ecf315f95238d9a /lib/gitlab/gitaly_client.rb
parent2e56b134687ccc8043f14eef4c5d0bfa9e1fd370 (diff)
Fix Gitaly auto-detection caching
If `GitalyClient#can_use_disk?` returned `false`, it was never cached properly and led to excessive number of Gitaly calls. Instead of using `cached_value.present?`, we need to check `cached_value.nil?`. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64802
Diffstat (limited to 'lib/gitlab/gitaly_client.rb')
-rw-r--r--lib/gitlab/gitaly_client.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index e7319a7b7f0..c98de722fe1 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -392,7 +392,7 @@ module Gitlab
@can_use_disk[storage]
end
- return cached_value if cached_value.present?
+ return cached_value unless cached_value.nil?
gitaly_filesystem_id = filesystem_id(storage)
direct_filesystem_id = filesystem_id_from_disk(storage)