-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
add WaitForSchedule(s) funcs #162
Conversation
scheduler.go
Outdated
// new jobs with the WaitForSchedule option as true. | ||
// The jobs will not start immediately but rather will | ||
// wait until their first scheduled interval. | ||
func (s *Scheduler) WaitForSchedules() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the users might think WaitForSchedules()
and WaitForSchedule()
have the same behavior. Because we have other methods like Second()
-Seconds()
, Minute()
-Minutes()
etc which in spite of being singular and plural have the same behavior.
The comments are clear enough, but maybe a different name for WaitForSchedules
might be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. Thoughts on the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WaitForSchedulesAllJobs()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Or if the word "Hold" makes sense, they can both be changed to HoldJobTillFirstSchedule
and HoldAllJobsTillFirstSchedule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also skip the word "First" to make it shorter :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about WaitForScheduleAll
i pushed that, let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure 👍🏽
What does this do?
WaitForSchedule
andWaitForSchedules
to allow setting per job or for all jobs to wait for the first scheduled run rather than running immediatelyNewJob
method. There was no use for it to be exported as we don't accept a newly created job struct in any scheduler methods. alters the signature to handle the wait for interval logicWhich issue(s) does this PR fix/relate to?
#152
List any changes that modify/break current functionality
Have you included tests for your changes?
Did you document any new/modified functionality?
example_test.go
README.md
Notes