0

config/schedule.yml

my_first_job: cron: "*/5 * * * *" class: "HardWorker" queue: hard_worker

second_job: cron: "*/30 * * * *" # execute at every 30 minutes class: "HardWorker" queue: hard_worker_long args: hard: "stuff"

1 Answers1

0

Have you added a sidekiq initializer that loads the file if it exists. You can use the YAML.load

Example

# config/initializers/sidekiq.rb
cron_schedule_file = 'config/cron_schedule.yml'

if File.exist?(cron_schedule_file) && Sidekiq.server?
  Sidekiq::Cron::Job.load_from_hash YAML.load_file(cron_schedule_file)
end
N. Maina
  • 1
  • 1