Create crond scheduler and dependencies and store to disk
This commit is contained in:
19
scheduler/parser.go
Normal file
19
scheduler/parser.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user