Commit f9b51644 by huangchengyi

1..0

parent 75a28d2b
......@@ -2,11 +2,9 @@ package main
import (
"flag"
"fmt"
"go_sku_server/boot"
"go_sku_server/pkg/logger"
"go_sku_server/service"
"github.com/jasonlvhit/gocron"
)
//定时任务计算系数价格
......@@ -25,21 +23,4 @@ func main() {
logger.Log("启动任务","ratio",1)
ZyCronService := service.ZyCronService{}
ZyCronService.ZyDiscount(goods_id)
if goods_id != "" {
//定时任务,每隔3天统计一次
err := gocron.Every(3).Day().At("1:20").Do(ZyDiscount,goods_id)
<- gocron.Start()
fmt.Print("启动任务状态",err)
}
}
/*
任务执行
*/
func ZyDiscount(goods_id string) {
logger.Log("定时执行任务","ratio",1)
ZyCronService := service.ZyCronService{}
ZyCronService.ZyDiscount(goods_id)
}
\ No newline at end of file
......@@ -16,6 +16,9 @@ func InitRouter() *gin.Engine {
r.GET("synchronization", controller.Synchronization)
r.POST("synchronization",controller.Synchronization)
//联营参数选择搜索
r.GET("Synchronization", controller.Synchronization)
r.POST("Synchronization",controller.Synchronization)
//心跳
r.GET("Health", controller.Health)
r.POST("Health",controller.Health)
......
......@@ -32,7 +32,6 @@ type ZiyingService struct {
@param power[verify_blacklist] 是否验证黑名单,用于折扣活动提交订单页面与后台下单 :true
*/
func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context,goodsIds []string,goodsRes *sync.Map, wg *sync.WaitGroup) {
redisConn := gredis.Conn("search_r")
defer func() {
wg.Done();
......
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