-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
Hashed cron expression support #155
Comments
A great improvement on my code by @TimWolla here: symfony/symfony#49792 (comment)! |
Interesting, so for my example above, the new syntax would look like? new HashedCronExpression('~ 0~2 * * ~', 'some context'); In OpenBSD, I think the time is randomized for each run (not deterministic) or am I wrong on that? |
Yes, this is my understanding. It would now also allow
Not sure, I don't use it. I came across the HN submission and thought I'd share it, because it is related. |
The problem with "jitter" in this library is that because it has no state, there's no guarantee that a cron will validate, nor to stop it from running multiple times within the jitter window. In this case, wrapping this library and extending is probably actually the best case. Then an individual task-running system can handle that any way they want (currently I'm happy to leave this open if we get a decent traction, because I'm slowly moving things over to phpixie-cron where it will be easier to group more of these over-the-top implementations. |
The suggestion would just be an “expression generator” that takes a pattern and a seed and returns a deterministic expression. The purpose would be generating different execution times within a fleet of servers, without storing state. |
Hello, curious if there's any interest in adding support for "hashed" cron expressions. This is a feature I ported to PHP from Jenkins in zenstruck/schedule-bundle (this link describes the feature).
If interested, how should it be added? One thing it needs is a context string to use to make the resulting expression deterministic:
The text was updated successfully, but these errors were encountered: