0
0
Fork 0

Clean up redis configuration. Allow using REDIS_URL to set advanced (#2732)

connection options instead of setting REDIS_HOST etc individually

Close #1986
This commit is contained in:
Eugen Rochko 2017-05-03 23:18:13 +02:00 committed by GitHub
parent 005f1fd360
commit c997091166
8 changed files with 53 additions and 61 deletions

View file

@ -1,12 +1,9 @@
host = ENV.fetch('REDIS_HOST') { 'localhost' }
port = ENV.fetch('REDIS_PORT') { 6379 }
password = ENV.fetch('REDIS_PASSWORD') { false }
db = ENV.fetch('REDIS_DB') { 0 }
# frozen_string_literal: true
Sidekiq.configure_server do |config|
config.redis = { host: host, port: port, db: db, password: password }
config.redis = { url: ENV['REDIS_URL'] }
end
Sidekiq.configure_client do |config|
config.redis = { host: host, port: port, db: db, password: password }
config.redis = { url: ENV['REDIS_URL'] }
end