Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where to initialize schedule.yml file for sidekiq scheduler

I have a config/schedule.yml file which has cron for recurring jobs in my app. But I am not sure where/how to initialize that file? In Resque we used to initialize it in resque.rake file.

like image 386
Bhushan Lodha Avatar asked Dec 31 '25 03:12

Bhushan Lodha


1 Answers

Sidekiq is not really made for recurring jobs. Quoting from the sidekiq github wiki page:

For recurring tasks, I recommend using the clockwork or whenever gems which integrate with your system's cron to schedule tasks.

I have not used sidekiq (but other similar tools like delayed_job and pure ruby schedulers like rufus_scheduler) but a major problem with non-cron based tools is to guarantee the recurring jobs will actually be executed and only the number of times you desired to. In an typical production environment with passenger it can easily happen for all ruby process to cease (thus no execution at all) or twenty processes all trying to execute the same job.

We long switched to whenever for which it is fun writing recurring jobs and which takes care of all the hassels in adding cronjobs to your system.

If you really want a easier solution and have no need for reliable execution rufus_scheduler is an option

like image 170
Michael Avatar answered Jan 02 '26 21:01

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!