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:
Diffstat (limited to 'lib/gitlab/repository_hash_cache.rb')
-rw-r--r--lib/gitlab/repository_hash_cache.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/repository_hash_cache.rb b/lib/gitlab/repository_hash_cache.rb
index 1ecdf506208..ea90a341b1e 100644
--- a/lib/gitlab/repository_hash_cache.rb
+++ b/lib/gitlab/repository_hash_cache.rb
@@ -139,8 +139,17 @@ module Gitlab
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)
- Gitlab::Redis::Cache.with(&blk) # rubocop:disable CodeReuse/ActiveRecord
+ cache.with(&blk) # rubocop:disable CodeReuse/ActiveRecord
end
# Take a hash and convert both keys and values to strings, for insertion into Redis.