summaryrefslogtreecommitdiff
path: root/lib/gitlab/repository_set_cache.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/repository_set_cache.rb')
-rw-r--r--lib/gitlab/repository_set_cache.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gitlab/repository_set_cache.rb b/lib/gitlab/repository_set_cache.rb
index baf48fd0dc1..c67ca92af40 100644
--- a/lib/gitlab/repository_set_cache.rb
+++ b/lib/gitlab/repository_set_cache.rb
@@ -64,5 +64,20 @@ module Gitlab
redis.sscan_each(full_key, match: pattern)
end
end
+
+ private
+
+ def cache
+ if Feature.enabled?(:use_primary_and_secondary_stores_for_repository_cache) ||
+ Feature.enabled?(:use_primary_store_as_default_for_repository_cache)
+ Gitlab::Redis::RepositoryCache
+ else
+ Gitlab::Redis::Cache
+ end
+ end
+
+ def with(&blk)
+ cache.with(&blk) # rubocop:disable CodeReuse/ActiveRecord
+ end
end
end