diff --git a/config/initializers/01_redis.rb b/config/initializers/01_redis.rb index b35757853..25084d9ec 100644 --- a/config/initializers/01_redis.rb +++ b/config/initializers/01_redis.rb @@ -1,14 +1,16 @@ -# 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 +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) + # 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 diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 66262ea43..d37128b8b 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -12,4 +12,6 @@ Sidekiq.configure_server do |config| end # https://github.com/ondrejbartas/sidekiq-cron -Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) if File.exist?(schedule_file) && Sidekiq.server? +Rails.application.reloader.to_prepare do + Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) if File.exist?(schedule_file) && Sidekiq.server? +end