-
Notifications
You must be signed in to change notification settings - Fork 7
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
Question: Job runs daily rather following the days of the week provided #19
Comments
This is similar to #17 in that we should probably change the documentation to reflect this use case better. There are two issues at play, one documentation and one a bug it would seem. The The second issue is with To do what you're after, you'll want to create 5 tasks (name them differently as the overnight_mon_task:
class: "DailyJob"
every: "1.week"
at: "Mon 20:00"
expires_after: "23.hours"
overnight_tue_task:
class: "DailyJob"
every: "1.week"
at: "Tue 20:00"
expires_after: "23.hours"
overnight_wed_task:
class: "DailyJob"
every: "1.week"
at: "Wed 20:00"
expires_after: "23.hours"
overnight_thu_task:
class: "DailyJob"
every: "1.week"
at: "Thu 20:00"
expires_after: "23.hours"
overnight_fri_task:
class: "DailyJob"
every: "1.week"
at: "Fri 20:00"
expires_after: "23.hours" |
Thanks for the awesome reply, as it's very much appreciated! Almost all of our jobs should run only Monday-Friday. Hence, would you suggest using a check after the job runs to see what day of the week it is in order to reduce duplicate code? |
That is 100% an option. If you remove the day of the week entirely, the job can run every day. Checking when it was scheduled is a breeze since your job can accept |
@bmedenwald - That solves that so problem so thank you! Since I'm using Rails 5, I used:
|
Awesome. I'm gong to reopen this issue though to track a change I'm planning to better detect an invalid date. |
I have the following setup in config/simple_scheduler.rb. We'd like the job to only be run M-F, and tried to configure it using the code below. Do you have any suggestions as it ran today (i.e. Saturday)?
The text was updated successfully, but these errors were encountered: