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

Add Jitter #525

Open
wants to merge 12 commits into
base: v3
Choose a base branch
from
Open

Add Jitter #525

wants to merge 12 commits into from

Conversation

mohsenpashna
Copy link

@mohsenpashna mohsenpashna commented Jul 8, 2024

Add some Jitter to the Entry's scheduled time. The actual jitter used will be randomly chosen within the range [0, Jitter]. The jitter will always be converted to a positive duration. Plus:

  • AddFuncWithJitter adds a func to the Cron to be run on the given schedule. The spec is parsed using the time zone of this Cron instance as the default. An opaque ID is returned that can be used to later remove it.

  • AddJobWithJitter adds a Job to the Cron to be run on the given schedule with a specified amount of jitter for each invocation. The spec is parsed using the time zone of this Cron instance as the default. An opaque ID is returned that can be used to later remove it.

  • ScheduleWithJitter adds a Job to the Cron to be run on the given schedule with a specified amount of jitter for each invocation. The job is wrapped with the configured Chain.

  • WithTimeCallback uses the provided time function callback for getting the current time.

Jeremy Scott and others added 12 commits January 14, 2022 12:01
[ch11410] - Fork Cron library and allow configuration of timing function
[ch11410] - Fork Cron library and allow configuration of timing function
[ch12701] - Fixed issue where custom time callback was used for first event, but not for subsequent events.
…ehaviour

[GRM-287] - Tasks scheduled by the scheduler seem to either behave erratically or don't run at all.
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.

2 participants