Class: Gitlab::Redis::RepositoryCache

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/gitlab/redis/repository_cache.rb

Constant Summary collapse

RepositoryCacheStore =

We create a subclass only for the purpose of differentiating between different stores in cache metrics

Class.new(ActiveSupport::Cache::RedisCacheStore)

Constants inherited from Wrapper

Wrapper::InvalidPathError

Class Method Summary collapse

Methods inherited from Wrapper

config_file_name, config_file_path, #db, #initialize, instrumentation_class, #params, pool, pool_size, rails_root, redis_yml_path, #sentinels, #sentinels?, #store, store_name, #url, version, with

Constructor Details

This class inherits a constructor from Gitlab::Redis::Wrapper

Class Method Details

.cache_storeObject



15
16
17
18
19
20
21
22
23
# File 'lib/gitlab/redis/repository_cache.rb', line 15

def cache_store
  @cache_store ||= RepositoryCacheStore.new(
    redis: pool,
    pool: false,
    compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
    namespace: Cache::CACHE_NAMESPACE,
    expires_in: Cache.default_ttl_seconds
  )
end

.config_fallbackObject

The data we store on RepositoryCache used to be stored on Cache.



11
12
13
# File 'lib/gitlab/redis/repository_cache.rb', line 11

def config_fallback
  Cache
end