diff options
Diffstat (limited to 'lib/gitlab/repository_hash_cache.rb')
-rw-r--r-- | lib/gitlab/repository_hash_cache.rb | 11 |
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. |