fix: Autoloading during initialization deprecation warning (#5628)

Autoloading during initialization deprecation warning fix
fixes: #4012
This commit is contained in:
Arkadiy Ayvazyan
2022-11-01 23:19:42 -04:00
committed by GitHub
parent 6cfd594d85
commit 86ca7f4a8d
2 changed files with 17 additions and 13 deletions

View File

@@ -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