-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
fix calculateMonths #104
fix calculateMonths #104
Conversation
… base time is not consistency
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.
Hey @sdw2330976, thanks for your contribution! 🎉
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.
lgtm
i think the tests could use some enhancements
@@ -191,7 +191,7 @@ func (s *Scheduler) calculateMonths(job *Job, lastRun time.Time) time.Duration { | |||
nextRun = nextRun.AddDate(0, int(job.interval), daysDifference) | |||
} | |||
} | |||
return s.until(lastRunRoundedMidnight, nextRun) | |||
return s.until(lastRun, nextRun) |
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.
@sdw2330976 do you have a time scenario where this fails with lastRunRoundedMidnight
? We can fake the time for a test, but ideally we could prove the old logic doesn't work with our test
Co-authored-by: John Roesler <[email protected]>
when we use every month at some time,then calculate next run time use base time is not consistency
What does this do?
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?
example_test.go
README.md
Notes