Revert "fix: Autoloading during initialization deprecation warning (#5628)"

This reverts commit 86ca7f4a8d.
This commit is contained in:
Vishnu Narayanan 2022-12-06 13:21:32 +05:30
parent 89cfc5bbf3
commit 37db0a1c83
2 changed files with 14 additions and 18 deletions

View file

@ -1,16 +1,14 @@
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.new(size: 5, timeout: 3) do
$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.new(size: 5, timeout: 3) do
config = Rails.env.test? ? MockRedis.new : Redis.new(Redis::Config.app)
Redis::Namespace.new('velma', redis: config, warning: true)
end
$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

View file

@ -12,6 +12,4 @@ Sidekiq.configure_server do |config|
end
# https://github.com/ondrejbartas/sidekiq-cron
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