diff options
Diffstat (limited to 'lib/gitlab/redis/cache.rb')
-rw-r--r-- | lib/gitlab/redis/cache.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/gitlab/redis/cache.rb b/lib/gitlab/redis/cache.rb index 98b66080b42..a2c7b5e29db 100644 --- a/lib/gitlab/redis/cache.rb +++ b/lib/gitlab/redis/cache.rb @@ -5,12 +5,15 @@ module Gitlab class Cache < ::Gitlab::Redis::Wrapper CACHE_NAMESPACE = 'cache:gitlab' - private - - def raw_config_hash - config = super - config[:url] = 'redis://localhost:6380' if config[:url].blank? - config + # Full list of options: + # https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new + def self.active_support_config + { + redis: pool, + compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')), + namespace: CACHE_NAMESPACE, + expires_in: 2.weeks # Cache should not grow forever + } end end end |