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

fixes related to the bug where a job unexpectedly runs twice #810

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

JohnRoesler
Copy link
Contributor

What does this do?

Addresses edge cases that could result in a job running twice unexpectedly.

There are reports of jobs being run very close together when they should not be -> #789.

What this fixes:

  • In the daily, weekly and monthly next() functions, the nanosecond time values were being included inconsistently on the day calculations. Since AtTime only considers hour, min, sec, there is risk in including the nanosecond values, as I could see it resulting in next run values being incorrect. Instead, just anchoring to zero nanoseconds.
  • In the scheduler's reschedule logic, check to make sure we're not adding duplicate time values to the nextScheduled slice. Since this is used to schedule from, having a duplicate value could result in the same time being set for the job to run

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

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.

1 participant