Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-19 23:58:44 +0300
committerStan Hu <stanhu@gmail.com>2019-08-06 01:52:52 +0300
commitb5771bccc6031c3adbdee31064f1c0c981ab73d4 (patch)
treed77c04677d8ed026ba2d00f5f68caac8e2355296 /config
parent029381b1d9219ad6fd5ed68f2f93e418f1dd55ca (diff)
Use Rails 5.2 Redis caching store
This is the first step in providing a fault-tolerant and distributed Redis caching store. We disable compression to avoid introducing a change that could have an adverse effect in production. Note that we won't be able to take advantage of the fault-tolerance and distributed features yet until we solve https://gitlab.com/gitlab-org/gitlab-ce/issues/64829. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64794
Diffstat (limited to 'config')
-rw-r--r--config/application.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb
index 92240426b5a..21cb79f7851 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -233,7 +233,10 @@ module Gitlab
end
# 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[:compress] = false
caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE
caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
if Sidekiq.server? # threaded context
@@ -241,7 +244,7 @@ module Gitlab
caching_config_hash[:pool_timeout] = 1
end
- config.cache_store = :redis_store, caching_config_hash
+ config.cache_store = :redis_cache_store, caching_config_hash
config.active_job.queue_adapter = :sidekiq