Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to run every hour at :00? #43

Open
quoine-doug opened this issue Mar 3, 2018 · 2 comments
Open

Is it possible to run every hour at :00? #43

quoine-doug opened this issue Mar 3, 2018 · 2 comments

Comments

@quoine-doug
Copy link

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

@Epigene
Copy link

Epigene commented Mar 29, 2018

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 }

@morgoth
Copy link

morgoth commented Oct 20, 2021

@quoine-doug Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants