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_set_cache.rb | |
parent | aa542224bb345acf0cb9a1a606f0a802c16b0336 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/repository_set_cache.rb')
-rw-r--r-- | lib/gitlab/repository_set_cache.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/gitlab/repository_set_cache.rb b/lib/gitlab/repository_set_cache.rb index 8035946090a..6d3ac53a787 100644 --- a/lib/gitlab/repository_set_cache.rb +++ b/lib/gitlab/repository_set_cache.rb @@ -25,7 +25,7 @@ module Gitlab end def read(key) - with { |redis| redis.sscan_each(cache_key(key)).to_a } + with { |redis| redis.smembers(cache_key(key)) } end def write(key, value) @@ -47,10 +47,11 @@ module Gitlab end def fetch(key, &block) - result = read(key) - return result unless result.empty? - - write(key, yield) + if exist?(key) + read(key) + else + write(key, yield) + end end def include?(key, value) |