ruby-on-railsrubyclockwork

Run job every 10 minutes with Clockwork


I would like a job to run every 10 minutes in Clockwork, but I want it to run 6 times an hour, at 00, 10, 20, 30, 40, and 50 minutes past.

In the Clockwork readme it says you can use wildcards for hour and minute values:

Wildcards for hour and minute are supported:

every(1.hour, 'reminders.send', :at => '**:30')
every(10.seconds, 'frequent.job', :at => '9:**')

However when I tried at: '**:*0' it gave me an error.


Solution

  • Hello @benjamin seems to be wildcards characters can be used either or hours or minutes, and seems to be Clockwork doesn't support partial wildcards like **:*0

    you can pass array to at option to achieve your goal You can set more than one timing

    every(10.seconds, 'reminders.send', :at => ['**:00', '**:10', '**:20', '**:30', '**:40', '**:50'])