Search code examples
ruby-on-railscronsidekiq

How to set up a Sidekiq Job to run every ten minutes until 23:59


I have this job set up in sidekiq to run every 10 minutes every day.

The problem is that I need it to run at 23:59 instead of running at 00:00. Is it possible to specify this exception in cron?

monitored_place_worker:
  cron: '*/10 * * * *'
  class: 'MonitoredPlacePoolWorker'
  queue: default
  active_job: true

Solution

  • You can add two scheduler rules. One - almost the same as yours: cron: '*/10 0-23 * * *' but for hours 0 through 23.

    And the second rules for past 23th hour like this cron: 0,10,20,30,40,50,59 23 * * *