Class: Gitlab::Redis::Cache

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

Constant Summary collapse

CACHE_NAMESPACE =
'cache:gitlab'

Constants inherited from Wrapper

Wrapper::InvalidPathError

Class Method Summary collapse

Methods inherited from Wrapper

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

Constructor Details

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

Class Method Details

.active_support_configObject



17
18
19
20
21
22
23
24
25
# File 'lib/gitlab/redis/cache.rb', line 17

def active_support_config
  {
    redis: pool,
    pool: false,
    compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
    namespace: CACHE_NAMESPACE,
    expires_in: default_ttl_seconds
  }
end

.default_ttl_secondsObject



27
28
29
# File 'lib/gitlab/redis/cache.rb', line 27

def default_ttl_seconds
  ENV.fetch('GITLAB_RAILS_CACHE_DEFAULT_TTL_SECONDS', 8.hours).to_i
end