Create crond scheduler and dependencies and store to disk

This commit is contained in:
bel
2020-03-12 15:14:25 -06:00
parent f022b26987
commit 65655080dd
12 changed files with 514 additions and 0 deletions

19
scheduler/parser.go Normal file
View File

@@ -0,0 +1,19 @@
package scheduler
import cron "github.com/robfig/cron/v3"
func getParser() cron.Parser {
return cron.NewParser(
cron.Minute |
cron.Hour |
cron.Dom |
cron.Month |
cron.Dow |
cron.Descriptor,
)
}
func validCron(s string) bool {
_, err := getParser().Parse(s)
return err == nil
}