Chatwoot/config/initializers/01_redis.rb
Arkadiy Ayvazyan 86ca7f4a8d
fix: Autoloading during initialization deprecation warning (#5628)
Autoloading during initialization deprecation warning fix
fixes: #4012
2022-11-01 20:19:42 -07:00

16 lines
639 B
Ruby

Rails.application.reloader.to_prepare do
# Alfred
# Add here as you use it for more features
# Used for Round Robin, Conversation Emails & Online Presence
$alfred = ConnectionPool::Wrapper.new(size: 5, timeout: 3) do
redis = Rails.env.test? ? MockRedis.new : Redis.new(Redis::Config.app)
Redis::Namespace.new('alfred', redis: redis, warning: true)
end
# Velma : Determined protector
# used in rack attack
$velma = ConnectionPool::Wrapper.new(size: 5, timeout: 3) do
redis = Rails.env.test? ? MockRedis.new : Redis.new(Redis::Config.app)
Redis::Namespace.new('velma', redis: redis, warning: true)
end
end