-
-
Notifications
You must be signed in to change notification settings - Fork 243
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 Cron
module and Schedule.cron
constructor
#1855
Conversation
🦋 Changeset detectedLatest commit: 1c8ebbf The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
if (now < previous[0]) { | ||
return core.succeed([ | ||
[false, previous], | ||
[previous[1], previous[2]], | ||
ScheduleDecision.continueWith(Interval.make(previous[1], previous[2])) | ||
]) | ||
} |
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.
This is an optimization that makes this work with composed schedules without the overhead of re-calculating the next
Cron interval repeatedly (e.g. when composing this with sth. like Schedule.fixed
at second
intervals "run every second on the first minute of the second hour of each monday between january and march" :-P)
Is there any usage expectation of Cron apart from Schedule? if not it could be an internal module |
Would that be your preference? I don't have a strong preference either way. I can /see/ this being useful outside of There are several cron npm packages with a few million weekly downloads:
Hard to say for what these are mostly used. I don't see much harm in maintaining this as a public module other than the maintenance burden. Your call ;-) |
My question was more out of curiosity, I agree regarding the maintenance burden, if this is stable it can be publicly exposed, only downside is if this is not stable and leads to breaking changes. I don't have a strong opinion, we can start having it public for now and reserve the right to decide otherwise if we feel like. |
match
calculatornext
calculatorSchedule.cron
constructorSchedule.cron
Fixes #1524