|
@@ -2,14 +2,15 @@ package service
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
- "github.com/caixw/lib.go/conv"
|
|
|
- "github.com/robfig/cron/v3"
|
|
|
- "github.com/sirupsen/logrus"
|
|
|
"log"
|
|
|
"time"
|
|
|
"youngee_m_api/consts"
|
|
|
"youngee_m_api/db"
|
|
|
"youngee_m_api/model/gorm_model"
|
|
|
+
|
|
|
+ "github.com/caixw/lib.go/conv"
|
|
|
+ "github.com/robfig/cron/v3"
|
|
|
+ "github.com/sirupsen/logrus"
|
|
|
)
|
|
|
|
|
|
func AutoTask() error {
|
|
@@ -205,7 +206,7 @@ func AutoTask() error {
|
|
|
//定时任务
|
|
|
//spec := "*/30 * * * * ?" //cron表达式,每30秒一次
|
|
|
spec := "0 */1 * * * ?" //cron表达式,每一分钟执行一次
|
|
|
- //spec := "0 0 * * * *" //每小时执行
|
|
|
+ // spec := "0 0 * * * *" //每小时执行
|
|
|
// 添加定时任务,
|
|
|
_, err := crontab.AddFunc("0 0 * * * *", taskKDStatus)
|
|
|
//_, err := crontab.AddFunc("*/30 * * * * ?", taskKDStatus)
|