diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 21:06:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 21:06:28 +0300 |
commit | 7b25b12016eeca73262cf2a618b411fb911295e1 (patch) | |
tree | 9198dc42c9f1151184f276d11d90c5193544eb1c /lib/gitlab/repository_cache_adapter.rb | |
parent | aa542224bb345acf0cb9a1a606f0a802c16b0336 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/repository_cache_adapter.rb')
-rw-r--r-- | lib/gitlab/repository_cache_adapter.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/gitlab/repository_cache_adapter.rb b/lib/gitlab/repository_cache_adapter.rb index 6d216217bdf..b2dc92ce010 100644 --- a/lib/gitlab/repository_cache_adapter.rb +++ b/lib/gitlab/repository_cache_adapter.rb @@ -58,16 +58,11 @@ module Gitlab # wrong answer. We handle that by querying the full list - which fills # the cache - and using it directly to answer the question. define_method("#{name}_include?") do |value| - return __send__(name).include?(value) if strong_memoized?(name) # rubocop:disable GitlabSecurity/PublicSend - - # If the member exists in the set, return as such early. - return true if redis_set_cache.include?(name, value) - - # If it did not, make sure the collection exists. - # If the collection exists, then item does not. - return false if redis_set_cache.exist?(name) + if strong_memoized?(name) || !redis_set_cache.exist?(name) + return __send__(name).include?(value) # rubocop:disable GitlabSecurity/PublicSend + end - __send__(name).include?(value) # rubocop:disable GitlabSecurity/PublicSend + redis_set_cache.include?(name, value) end end |