diff options
author | Paul Charlton <techguru@byiq.com> | 2017-07-11 03:35:47 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-07-11 03:35:47 +0000 |
commit | cb3b4a15e6913bc28ee2ecaab017a4c3f08c438e (patch) | |
tree | dc3915aa94508d76df2480a8e26ec4b33797a320 /config/application.rb | |
parent | 4daa6da5407d235cbe4f7a787eaa29304446a870 (diff) | |
download | gitlab-ce-cb3b4a15e6913bc28ee2ecaab017a4c3f08c438e.tar.gz |
Support multiple Redis instances based on queue type
Diffstat (limited to 'config/application.rb')
-rw-r--r-- | config/application.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/config/application.rb b/config/application.rb index 2f4e2624195..1c13cc81270 100644 --- a/config/application.rb +++ b/config/application.rb @@ -6,7 +6,9 @@ Bundler.require(:default, Rails.env) module Gitlab class Application < Rails::Application - require_dependency Rails.root.join('lib/gitlab/redis') + require_dependency Rails.root.join('lib/gitlab/redis/cache') + require_dependency Rails.root.join('lib/gitlab/redis/queues') + require_dependency Rails.root.join('lib/gitlab/redis/shared_state') require_dependency Rails.root.join('lib/gitlab/request_context') # Settings in config/environments/* take precedence over those specified here. @@ -142,15 +144,15 @@ module Gitlab end end - # Use Redis caching across all environments - redis_config_hash = Gitlab::Redis.params - redis_config_hash[:namespace] = Gitlab::Redis::CACHE_NAMESPACE - redis_config_hash[:expires_in] = 2.weeks # Cache should not grow forever + # Use caching across all environments + caching_config_hash = Gitlab::Redis::Cache.params + 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 - redis_config_hash[:pool_size] = Sidekiq.options[:concurrency] + 5 - redis_config_hash[:pool_timeout] = 1 + caching_config_hash[:pool_size] = Sidekiq.options[:concurrency] + 5 + caching_config_hash[:pool_timeout] = 1 end - config.cache_store = :redis_store, redis_config_hash + config.cache_store = :redis_store, caching_config_hash config.active_record.raise_in_transactional_callbacks = true |