mh_goadmin_server/pkg/cronjob/gadmjob.go
2023-09-16 10:56:39 +08:00

13 lines
360 B
Go

package cronjob
import (
"github.com/robfig/cron/v3"
)
// newWithSeconds returns a Cron with the seconds field enabled.
func NewWithSeconds() *cron.Cron {
secondParser := cron.NewParser(cron.Second | cron.Minute |
cron.Hour | cron.Dom | cron.Month | cron.DowOptional | cron.Descriptor)
return cron.New(cron.WithParser(secondParser), cron.WithChain())
}