fix:支付
This commit is contained in:
parent
e991ee3966
commit
821c2063c9
|
@ -34,7 +34,7 @@ func main() {
|
|||
ctx := svc.NewServiceContext(c)
|
||||
handler.RegisterHandlers(server, ctx)
|
||||
|
||||
go ctx.Repositories.NewOrder.CloseList(context.Background(), &repositories.CloseListReq{})
|
||||
go ctx.Repositories.NewOrder.CloseList(context.Background(), &repositories.CloseListReq{Type: 1})
|
||||
|
||||
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
|
||||
server.Start()
|
||||
|
|
|
@ -217,16 +217,18 @@ func (d *defaultOrder) CloseList(ctx context.Context, in *CloseListReq) (res *Cl
|
|||
} else {
|
||||
dtime = time.Now().Add(time.Second * time.Duration(math.Abs(float64(dd))))
|
||||
}
|
||||
// 延时任务
|
||||
d.DelayQueue.AddTask(dtime, constants.QUEUE_NAME_ORDER, func(args ...interface{}) {
|
||||
ctx := context.Background()
|
||||
orderSn := args[0].(string)
|
||||
logc.Infof(ctx, "order close, orderSn: %s", orderSn)
|
||||
d.Close(ctx, &CloseReq{
|
||||
OrderSn: orderSn,
|
||||
Type: 1,
|
||||
})
|
||||
}, []interface{}{*orderInfo.OrderSn})
|
||||
if in.Type == 1 {
|
||||
// 延时任务
|
||||
d.DelayQueue.AddTask(dtime, constants.QUEUE_NAME_ORDER, func(args ...interface{}) {
|
||||
ctx := context.Background()
|
||||
orderSn := args[0].(string)
|
||||
logc.Infof(ctx, "order close, orderSn: %s", orderSn)
|
||||
d.Close(ctx, &CloseReq{
|
||||
OrderSn: orderSn,
|
||||
Type: 1,
|
||||
})
|
||||
}, []interface{}{*orderInfo.OrderSn})
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user