Effect-TS / effect

An ecosystem of tools to build robust applications in TypeScript
https://effect.website
MIT License
7.71k stars 245 forks source link

Optimize `Cron.next` algorithm #3932

Open fubhy opened 1 week ago

fubhy commented 1 week ago

What is the problem this feature would solve?

The algorithm for finding the next cron time can be optimized quite a bit. Currently, we start each iteration again from the top even if we have not advanced the day/month yet.

What is the feature you are proposing to solve the problem?

...

What alternatives have you considered?

No response

fubhy commented 1 week ago

https://stackoverflow.com/questions/321494/calculate-when-a-cron-job-will-be-executed-then-next-time