Skip to content
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

Use robfig/cron to parse cron lines #327

Merged
merged 4 commits into from
Aug 17, 2020
Merged

Use robfig/cron to parse cron lines #327

merged 4 commits into from
Aug 17, 2020

Conversation

rubiojr
Copy link
Collaborator

@rubiojr rubiojr commented Jul 24, 2020

Handles parsing better, supporting the cron spec.

Partially addresses #293

Handles parsing better, supporting the cron spec.

Partially addresses #293
@rubiojr rubiojr changed the title Use robfig/cron to parse cron lines [WiP] Use robfig/cron to parse cron lines Jul 24, 2020
@rubiojr
Copy link
Collaborator Author

rubiojr commented Jul 24, 2020

This is ready for 👀 now. I ran go mod tidy so the diff is a bit larger than necessary.

@rubiojr rubiojr changed the title [WiP] Use robfig/cron to parse cron lines Use robfig/cron to parse cron lines Jul 24, 2020
@rubiojr
Copy link
Collaborator Author

rubiojr commented Jul 24, 2020

The format supported is documented in https://godoc.org/github.com/robfig/cron.

Field name   | Mandatory? | Allowed values  | Allowed special characters
----------   | ---------- | --------------  | --------------------------
Minutes      | Yes        | 0-59            | * / , -
Hours        | Yes        | 0-23            | * / , -
Day of month | Yes        | 1-31            | * / , - ?
Month        | Yes        | 1-12 or JAN-DEC | * / , -
Day of week  | Yes        | 0-6 or SUN-SAT  | * / , - ?

Tested with an old config I had around and seems to be backwards compatible. It seems to fix some issues the current parser has also, like no support for */X periods.

@muesli muesli merged commit d22455f into master Aug 17, 2020
@muesli
Copy link
Owner

muesli commented Aug 17, 2020

Fantastic!

@muesli muesli deleted the maintained-cron branch October 19, 2020 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants