package cron
|
|
import (
|
"gat1400Exchange/config"
|
"gat1400Exchange/service"
|
"github.com/go-co-op/gocron"
|
"time"
|
)
|
|
var s *gocron.Scheduler
|
|
func init() {
|
s = gocron.NewScheduler(time.UTC)
|
}
|
|
func Init() {
|
s.Every(config.ForwardConf.RetryInterval).Minute().StartImmediately().Do(service.ResendImageData)
|
s.Every(config.ForwardConf.ReportInterval).Second().StartImmediately().Do(service.DeviceInfoReportTask)
|
s.Every(1).Hour().StartImmediately().Do(service.CleanExpireData)
|
s.Every(config.SysTimeConf.SyncInterval).Minute().StartImmediately().Do(service.SyncSystemTime)
|
|
s.StartAsync()
|
}
|