2021-06-07 11:56:08 +00:00
|
|
|
require Rails.root.join('lib/redis/config')
|
|
|
|
|
2021-01-11 12:04:41 +00:00
|
|
|
schedule_file = 'config/schedule.yml'
|
|
|
|
|
2020-01-26 17:01:34 +00:00
|
|
|
Sidekiq.configure_client do |config|
|
2021-07-14 17:21:27 +00:00
|
|
|
config.redis = Redis::Config.app
|
2020-01-26 17:01:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Sidekiq.configure_server do |config|
|
2021-07-14 17:21:27 +00:00
|
|
|
config.redis = Redis::Config.app
|
2022-05-13 06:04:43 +00:00
|
|
|
config.logger.level = Logger.const_get(ENV.fetch('LOG_LEVEL', 'info').upcase.to_s)
|
2020-01-26 17:01:34 +00:00
|
|
|
end
|
2021-01-11 12:04:41 +00:00
|
|
|
|
|
|
|
# https://github.com/ondrejbartas/sidekiq-cron
|
2022-11-02 03:19:42 +00:00
|
|
|
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
|