mvniekerk / tokio-cron-scheduler

Schedule tasks on Tokio using cron-like annotation
Apache License 2.0
529 stars 59 forks source link

Swap from cron to croner-rust #77

Closed MGough closed 2 months ago

MGough commented 3 months ago

Related to #74

Swaps from the cron library to croner to support a wider range of cron expressions (see https://github.com/Hexagon/croner-rust?tab=readme-ov-file#why-croner-instead-of-cron-or-saffron)

This is a straight swap of the libraries. As croner doesn't provide a TryInto<Schedule, Error = E> trait I've removed some of the generic typing when constructing the schedules. To me this seemed preferable to writing a wrapper on the Croner::Cron type, but my rust experience is limited and I'm happy to take feedback and adjust as needed.

I've defaulted all usages of Croner::Cron to require the seconds field, as well as to use 'day of month' and 'day of week' to keep things the same as they were previously in this library.

mvniekerk commented 2 months ago

Hi @MGough and @adrian-kong Thank you for the PR. I'll have a look

mvniekerk commented 2 months ago

Hi @MGough and @adrian-kong I've added this to https://github.com/mvniekerk/tokio-cron-scheduler/pull/81 It is part of the 0.12.0 release