Add the task service for scan task.
This commit is contained in:
16
code/tool/util/util_cron.go
Normal file
16
code/tool/util/util_cron.go
Normal file
@ -0,0 +1,16 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"github.com/robfig/cron/v3"
|
||||
)
|
||||
|
||||
//validate a cron
|
||||
func ValidateCron(spec string) bool {
|
||||
|
||||
_, err := cron.ParseStandard(spec)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user