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

start jobs immediately by default #82

Merged
merged 3 commits into from
Nov 29, 2020
Merged

Conversation

JohnRoesler
Copy link
Contributor

What does this do?

The default behavior will now be that jobs start immediately unless scheduled at a specific time, for a specific weekday or on a specific day of the month.

Which issue(s) does this PR fix/relate to?

List any changes that modify/break current functionality

Have you included tests for your changes?

Did you document any new/modified functionality?

  • Updated example_test.go
  • Updated README.md

Notes

@@ -438,13 +440,6 @@ func (s *Scheduler) StartAt(t time.Time) *Scheduler {
return s
}

// StartImmediately sets the Jobs next run as soon as the scheduler starts
func (s *Scheduler) StartImmediately() *Scheduler {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a backward-incompatible change, right?
Is that ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could deprecate the fuction before removing it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like deprecating. Also, I made some updates. Setting the starts immediately value as true in the constructor and then false where appropriate in At, Start At, Weekday and Day of the Month

scheduler.go Outdated Show resolved Hide resolved
@JohnRoesler JohnRoesler merged commit 014228d into master Nov 29, 2020
@JohnRoesler JohnRoesler deleted the start-immediately-default branch November 29, 2020 18:52
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

Successfully merging this pull request may close these issues.

3 participants