summaryrefslogtreecommitdiff
path: root/lib/gitlab/set_cache.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 15:09:45 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 15:09:45 +0000
commitaaf59610548d9b0fd01acfd50e831cbe519ecba2 (patch)
treeb6505abedcd965ebae5118b504b185b63129dc4c /lib/gitlab/set_cache.rb
parent1363ca12f1f07c634647cf55c4c16b7401098673 (diff)
downloadgitlab-ce-aaf59610548d9b0fd01acfd50e831cbe519ecba2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/set_cache.rb')
-rw-r--r--lib/gitlab/set_cache.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/set_cache.rb b/lib/gitlab/set_cache.rb
index 2e72855824a..d1151a431bb 100644
--- a/lib/gitlab/set_cache.rb
+++ b/lib/gitlab/set_cache.rb
@@ -14,7 +14,10 @@ module Gitlab
"#{key}:set"
end
+ # Returns the number of keys deleted by Redis
def expire(*keys)
+ return 0 if keys.empty?
+
with do |redis|
keys = keys.map { |key| cache_key(key) }
unlink_or_delete(redis, keys)