clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

Is it possible to run every hour at :00?

Open quoine-doug opened this issue 7 years ago • 2 comments

How can I make it always run cleanly at :00? Also, is it possible to make it run every in a day, BUT run the last one at :59

quoine-doug avatar Mar 03 '18 05:03 quoine-doug

Your question is unclear. Let me try and help you.

What do you mean by "at :00"? If you mean at the turn of every hour, try this

every(1.day, "Test job", at: "**:00", skip_first_run: true) { SomeJob.add }

Making the last one run differently can make things much harder. Perhaps something like this:

(0..22).to_a.each do |hour|
  every(1.day, "Test job", at: "#{hour}:00", skip_first_run: true) { SomeJob.add }
end

every(1.day, "Test job", at: "23:59", skip_first_run: true) { SomeJob.add }

Epigene avatar Mar 29 '18 08:03 Epigene

@quoine-doug Can this be closed?

morgoth avatar Oct 20 '21 15:10 morgoth