[491] Bug fix - Sidekiq Redis Auth issue (#527)
* When the the .env file has line with REDIS_PASSWORD set as empty, the value for this in the initializers comes as an empty string "". * Fixed this in a way that, if it's empty string, then it's taken as `nil` value so that password is skipped
This commit is contained in:
parent
30e5edf6dc
commit
04c62417fa
3 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
development:
|
development:
|
||||||
adapter: redis
|
adapter: redis
|
||||||
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
||||||
password: <%= ENV.fetch('REDIS_PASSWORD', nil) %>
|
password: <%= ENV.fetch('REDIS_PASSWORD', nil).presence %>
|
||||||
|
|
||||||
test:
|
test:
|
||||||
adapter: test
|
adapter: test
|
||||||
|
@ -9,9 +9,9 @@ test:
|
||||||
staging:
|
staging:
|
||||||
adapter: redis
|
adapter: redis
|
||||||
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
||||||
password: <%= ENV.fetch('REDIS_PASSWORD', nil) %>
|
password: <%= ENV.fetch('REDIS_PASSWORD', nil).presence %>
|
||||||
|
|
||||||
production:
|
production:
|
||||||
adapter: redis
|
adapter: redis
|
||||||
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
url: <%= ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379') %>
|
||||||
password: <%= ENV.fetch('REDIS_PASSWORD', nil) %>
|
password: <%= ENV.fetch('REDIS_PASSWORD', nil).presence %>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
app_redis_config = {
|
app_redis_config = {
|
||||||
url: URI.parse(ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379')),
|
url: URI.parse(ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379')),
|
||||||
password: ENV.fetch('REDIS_PASSWORD', nil)
|
password: ENV.fetch('REDIS_PASSWORD', nil).presence
|
||||||
}
|
}
|
||||||
redis = Rails.env.test? ? MockRedis.new : Redis.new(app_redis_config)
|
redis = Rails.env.test? ? MockRedis.new : Redis.new(app_redis_config)
|
||||||
Nightfury.redis = Redis::Namespace.new('reports', redis: redis)
|
Nightfury.redis = Redis::Namespace.new('reports', redis: redis)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
sidekiq_redis_config = {
|
sidekiq_redis_config = {
|
||||||
url: ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379'),
|
url: ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379'),
|
||||||
password: ENV.fetch('REDIS_PASSWORD', nil)
|
password: ENV.fetch('REDIS_PASSWORD', nil).presence
|
||||||
}
|
}
|
||||||
|
|
||||||
Sidekiq.configure_client do |config|
|
Sidekiq.configure_client do |config|
|
||||||
|
|
Loading…
Reference in a new issue