满足压测处理
This commit is contained in:
parent
bab72020ad
commit
a91114d8ae
|
|
@ -20,37 +20,33 @@ func (v *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo) (or
|
||||||
|
|
||||||
err = lock.NewMutex(v.rdb.Rdb, c.TTL).Lock(bizCtx, c.Key, func(bizCtx context.Context) error {
|
err = lock.NewMutex(v.rdb.Rdb, c.TTL).Lock(bizCtx, c.Key, func(bizCtx context.Context) error {
|
||||||
|
|
||||||
// 压测商品直接过
|
order, err3 := v.OrderRepo.GetByOutBizNo(bizCtx, vo.OrderTypeCmb, req.OutBizNo)
|
||||||
if req.ProductNo != "001" {
|
|
||||||
|
|
||||||
order, err := v.OrderRepo.GetByOutBizNo(bizCtx, vo.OrderTypeCmb, req.OutBizNo)
|
if err3 != nil && !err2.IsDbNotFound(err3) {
|
||||||
|
return err3
|
||||||
if err != nil && !err2.IsDbNotFound(err) {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if order != nil {
|
if order != nil {
|
||||||
|
|
||||||
if order.Status.IsFail() {
|
if order.Status.IsFail() {
|
||||||
|
|
||||||
if err = v.orderRetry(bizCtx, order); err != nil {
|
if err4 := v.orderRetry(bizCtx, order); err4 != nil {
|
||||||
return err
|
return err4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
orderNo = order.OrderNo
|
orderNo = order.OrderNo
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
product, err3 := v.ProductRepo.GetByProductNo(bizCtx, req.ProductNo)
|
||||||
|
if err3 != nil {
|
||||||
|
return err3
|
||||||
}
|
}
|
||||||
|
|
||||||
product, err := v.ProductRepo.GetByProductNo(bizCtx, req.ProductNo)
|
order, err3 = v.order(bizCtx, req, product)
|
||||||
if err != nil {
|
if err3 != nil {
|
||||||
return err
|
return err3
|
||||||
}
|
|
||||||
|
|
||||||
order, err := v.order(bizCtx, req, product)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
orderNo = order.OrderNo
|
orderNo = order.OrderNo
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue