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|
|
2020-10-05 12:01:10 +00:00
|
|
|
config.redis = Redis::Config.sidekiq
|
2020-01-26 17:01:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Sidekiq.configure_server do |config|
|
2020-10-05 12:01:10 +00:00
|
|
|
config.redis = Redis::Config.sidekiq
|
2020-01-26 17:01:34 +00:00
|
|
|
end
|
2021-01-11 12:04:41 +00:00
|
|
|
|
|
|
|
# https://github.com/ondrejbartas/sidekiq-cron
|
|
|
|
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) if File.exist?(schedule_file) && Sidekiq.server?
|