about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorLes Orchard <me@lmorchard.com>2017-04-14 20:21:13 -0400
committerEugen <eugen@zeonfederated.com>2017-04-15 02:21:13 +0200
commit7609593e4833e32064313148c616053022274408 (patch)
tree665d33da77a45211759c4769ea8e9468224b4c03 /config/initializers
parenta9529d3b4b057eeb3b47943b271ad6605e22732d (diff)
Add REDIS_DB env variable to configure Redis database (#1366)
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/sidekiq.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index ecdd07b08..8ae3bd5a2 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -1,11 +1,12 @@
 host = ENV.fetch('REDIS_HOST') { 'localhost' }
 port = ENV.fetch('REDIS_PORT') { 6379 }
 password = ENV.fetch('REDIS_PASSWORD') { false }
+db = ENV.fetch('REDIS_DB') { 0 }
 
 Sidekiq.configure_server do |config|
-  config.redis = { host: host, port: port, password: password}
+  config.redis = { host: host, port: port, db: db, password: password }
 end
 
 Sidekiq.configure_client do |config|
-  config.redis = { host: host, port: port, password: password }
+  config.redis = { host: host, port: port, db: db, password: password }
 end