Skip to content
Snippets Groups Projects
Commit 2244aaf9 authored by Valery Sizov's avatar Valery Sizov
Browse files

Redis configuration consistency

parent 8cb41f19
No related branches found
No related tags found
No related merge requests found
Loading
@@ -14,7 +14,7 @@ if Rails.env.test?
Loading
@@ -14,7 +14,7 @@ if Rails.env.test?
Gitlab::Application.config.session_store :cookie_store, key: "_gitlab_session" Gitlab::Application.config.session_store :cookie_store, key: "_gitlab_session"
else else
redis_config = Gitlab::Redis.redis_store_options redis_config = Gitlab::Redis.redis_store_options
redis_config[:namespace] = 'session:gitlab' redis_config[:namespace] = Gitlab::Redis::SESSION_NAMESPACE
Gitlab::Application.config.session_store( Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks. :redis_store, # Using the cookie_store would enable session replay attacks.
Loading
Loading
SIDEKIQ_REDIS_NAMESPACE = 'resque:gitlab'
Sidekiq.configure_server do |config| Sidekiq.configure_server do |config|
config.redis = { config.redis = {
url: Gitlab::Redis.url, url: Gitlab::Redis.url,
namespace: SIDEKIQ_REDIS_NAMESPACE namespace: Gitlab::Redis::SIDEKIQ_NAMESPACE
} }
   
config.server_middleware do |chain| config.server_middleware do |chain|
Loading
@@ -30,6 +28,6 @@ end
Loading
@@ -30,6 +28,6 @@ end
Sidekiq.configure_client do |config| Sidekiq.configure_client do |config|
config.redis = { config.redis = {
url: Gitlab::Redis.url, url: Gitlab::Redis.url,
namespace: SIDEKIQ_REDIS_NAMESPACE namespace: Gitlab::Redis::SIDEKIQ_NAMESPACE
} }
end end
module Gitlab module Gitlab
class Redis class Redis
CACHE_NAMESPACE = 'cache:gitlab' CACHE_NAMESPACE = 'cache:gitlab'
SESSION_NAMESPACE = 'session:gitlab'
SIDEKIQ_NAMESPACE = 'resque:gitlab'
   
attr_reader :url attr_reader :url
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment