-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Optimize cron #4010
Optimize cron #4010
Conversation
🦋 Changeset detectedLatest commit: 0796582 The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 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 |
d3ed5dc
to
c2eb763
Compare
@IMax153 has agreed to review this. |
I think some more tests that cover off daylight savings, leap years etc. would be good. |
9e8c8d0
to
c7975a4
Compare
What Tim said :) |
c1f32a7
to
0d4aa4f
Compare
e9c8ce4
to
f47d935
Compare
Can you verify if this makes any sense now? After looking through various Cron implementations, I believe this is the simplest we can do whilst ticking "most" boxes. The only downside is that we skip the transition period when moving out of daylight savings time. I believe that's fine and after experimenting with all sorts of different Cron implementations, they all handle this differently in their own way (some repeat the same hour twice, some skip it like we do, some are outright bugged). I haven't found a way to elegantly solve this without adding complexity that is (imho) not waranted here. If we feel strongly that we also want to fully cover the transition period coming out of daylight savings time, we can address that in a follow-up imho. wdyt @tim-smart @IMax153 ? |
This should massively improve the efficiency (number of loops) for the
Cron.next
lookup. With this, I think we should also be able to support seconds & milisecond granularity.That said, it's already possible to compose schedules with second or milisecond ticks within an active Cron interval... So I'm not sure how valuable that'd be tbh.
Closes #3932