Chatwoot/config/initializers/redis.rb
Sony Mathew 04c62417fa
[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
2020-02-20 10:52:26 +05:30

10 lines
460 B
Ruby

app_redis_config = {
url: URI.parse(ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379')),
password: ENV.fetch('REDIS_PASSWORD', nil).presence
}
redis = Rails.env.test? ? MockRedis.new : Redis.new(app_redis_config)
Nightfury.redis = Redis::Namespace.new('reports', redis: redis)
# Alfred - Used currently for round robin and conversation emails.
# Add here as you use it for more features
$alfred = Redis::Namespace.new('alfred', redis: redis, warning: true)