Conversation
|
When I started this, I was following the Quartz scheduler's |
|
Is is my understanding that the cron implementation in linux only supports 5 fields. It is also my understanding that this is the more ubiquitous format; for example, saffron (from cloudflare) only supports 5-field expressions: https://github.com/cloudflare/saffron/blob/bb9bb16e112f9ab69161d55181ffc259708824ae/saffron/src/parse.rs#L632 I do need to fix the CI though, just noticed it's red. |
|
Cool, thanks. Can you add a unit test that iterates through the output of a couple of example 5-field schedules to make sure they work as expected? |
|
Just to add a note that wikipedia page on Cron also considers 5 fields to be standard: https://en.wikipedia.org/wiki/Cron |
| terminated(fields, eof) | ||
| .map(|(minutes, hours, days_of_month, months, days_of_week)| { | ||
| ScheduleFields::new( | ||
| Seconds::all(), |
There was a problem hiding this comment.
this should be zero right? You wouldn't want a 5 part to run every second.
This is my proposed implementation for #13. This allows 5-field expressions to be parsed without any change in the existing behavior. There's certainly more that can be done in this area, but I feel this is a useful step in the right direction.