Commit 0b2147a4 by huangchengyi

1.0

parent 4e7f8080
Showing with 6 additions and 4 deletions
...@@ -26,10 +26,12 @@ func main() { ...@@ -26,10 +26,12 @@ func main() {
ZyCronService := service.ZyCronService{} ZyCronService := service.ZyCronService{}
ZyCronService.ZyDiscount(goods_id) ZyCronService.ZyDiscount(goods_id)
//定时任务,每隔3天统计一次 if goods_id != "" {
err := gocron.Every(3).Day().At("1:20").Do(ZyDiscount,goods_id) //定时任务,每隔3天统计一次
<- gocron.Start() err := gocron.Every(3).Day().At("1:20").Do(ZyDiscount,goods_id)
fmt.Print("启动任务状态",err) <- gocron.Start()
fmt.Print("启动任务状态",err)
}
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment