Commit d487b460 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'sh-use-rails-redis-store' into 'master'

Use Rails 5.2 Redis caching store

See merge request gitlab-org/gitlab!19202
parents fb09d690 7dc0c5fd
---
title: Use Rails 5.2 Redis caching store
merge_request: 19202
author:
type: other
...@@ -247,7 +247,10 @@ module Gitlab ...@@ -247,7 +247,10 @@ module Gitlab
end end
# Use caching across all environments # Use caching across all environments
# Full list of options:
# https://api.rubyonrails.org/classes/ActiveSupport/Cache/RedisCacheStore.html#method-c-new
caching_config_hash = Gitlab::Redis::Cache.params caching_config_hash = Gitlab::Redis::Cache.params
caching_config_hash[:compress] = false
caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE
caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
if Sidekiq.server? # threaded context if Sidekiq.server? # threaded context
...@@ -255,7 +258,7 @@ module Gitlab ...@@ -255,7 +258,7 @@ module Gitlab
caching_config_hash[:pool_timeout] = 1 caching_config_hash[:pool_timeout] = 1
end end
config.cache_store = :redis_store, caching_config_hash config.cache_store = :redis_cache_store, caching_config_hash
config.active_job.queue_adapter = :sidekiq config.active_job.queue_adapter = :sidekiq
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment