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:
@ -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
|
||||
|
Reference in New Issue
Block a user