cron
This commit is contained in:
parent
01092097c8
commit
c8d6c0bc0e
|
@ -109,6 +109,21 @@ func (s *CronService) ClearVeriCodeSendTimes() {
|
|||
scheduler.StartAsync()
|
||||
}
|
||||
|
||||
func (s *CronService) ClearMomentCreateTimes() {
|
||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||
scheduler := gocron.NewScheduler(loc)
|
||||
|
||||
scheduler.Every(1).Day().At("00:00").Do(func() {
|
||||
logger.Info("Clearing moment_create_times collection...")
|
||||
ctx := &gin.Context{}
|
||||
if err := _DefaultMomentCreateTimes.OpClear(ctx); err != nil {
|
||||
logger.Error("Clear moment_create_times collection fail: %v", err)
|
||||
}
|
||||
logger.Info("moment_create_times collection has been cleared")
|
||||
})
|
||||
scheduler.StartAsync()
|
||||
}
|
||||
|
||||
// 统计每日报表
|
||||
func (s *CronService) CreateDailyStatement() {
|
||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||
|
|
Loading…
Reference in New Issue