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:
authorNick Thomas <nick@gitlab.com>2019-09-10 16:09:55 +0300
committerNick Thomas <nick@gitlab.com>2019-09-10 16:09:55 +0300
commit4cd6c91d5f1f3e58e2f2a58d16691d0651f24a7e (patch)
tree56c09d0dc9af7c21bbce3e976e5b620eea86ecc5 /lib/gitlab/repository_set_cache.rb
parent07323f44b74592e0991c5d3096e7fd0ca260fbab (diff)
Redis set cache docs and minor cleanup
Diffstat (limited to 'lib/gitlab/repository_set_cache.rb')
-rw-r--r--lib/gitlab/repository_set_cache.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/repository_set_cache.rb b/lib/gitlab/repository_set_cache.rb
index fb634328a95..6d3ac53a787 100644
--- a/lib/gitlab/repository_set_cache.rb
+++ b/lib/gitlab/repository_set_cache.rb
@@ -13,7 +13,7 @@ module Gitlab
end
def cache_key(type)
- [type, namespace, 'set'].join(':')
+ "#{type}:#{namespace}:set"
end
def expire(key)
@@ -37,7 +37,7 @@ module Gitlab
# Splitting into groups of 1000 prevents us from creating a too-long
# Redis command
- value.in_groups_of(1000, false) { |subset| redis.sadd(full_key, subset) }
+ value.each_slice(1000) { |subset| redis.sadd(full_key, subset) }
redis.expire(full_key, expires_in)
end