You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package cron
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/robfig/cron/v3"
|
|
)
|
|
|
|
type CronManage struct {
|
|
*cron.Cron
|
|
}
|
|
|
|
var c *CronManage
|
|
|
|
var once sync.Once
|
|
|
|
func GetCron() *CronManage {
|
|
once.Do(func() {
|
|
c = &CronManage{cron.New(cron.WithSeconds())}
|
|
})
|
|
return c
|
|
}
|