This commit is contained in:
shoopea 2019-12-12 17:45:27 +08:00
parent 3734239446
commit fdb36c7bcd

View File

@ -1,18 +1,20 @@
package main package main
import ( import (
"time"
//"github.com/robfig/cron/v3" //"github.com/robfig/cron/v3"
"gopkg.in/robfig/cron.v3" "gopkg.in/robfig/cron.v3"
) )
func startCron() *Cron { func startCron() *cron.Cron {
c := cron.New(cron.WithLocation(time.UTC)) c := cron.New(cron.WithLocation(time.UTC))
c.AddFunc("@every 1m", cronSendReport) c.AddFunc("@every 1m", cronSendReport)
c.Start() c.Start()
return return
} }
func stopCron(c *Cron) { func stopCron(c *cron.Cron) {
c.Stop() c.Stop()
return return
} }