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:
parent
005f1fd360
commit
c997091166
8 changed files with 53 additions and 61 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue