满足压测处理
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 {
|
||||
|
||||
// 压测商品直接过
|
||||
if req.ProductNo != "001" {
|
||||
order, err3 := v.OrderRepo.GetByOutBizNo(bizCtx, vo.OrderTypeCmb, req.OutBizNo)
|
||||
|
||||
order, err := v.OrderRepo.GetByOutBizNo(bizCtx, vo.OrderTypeCmb, req.OutBizNo)
|
||||
|
||||
if err != nil && !err2.IsDbNotFound(err) {
|
||||
return err
|
||||
if err3 != nil && !err2.IsDbNotFound(err3) {
|
||||
return err3
|
||||
}
|
||||
|
||||
if order != nil {
|
||||
|
||||
if order.Status.IsFail() {
|
||||
|
||||
if err = v.orderRetry(bizCtx, order); err != nil {
|
||||
return err
|
||||
if err4 := v.orderRetry(bizCtx, order); err4 != nil {
|
||||
return err4
|
||||
}
|
||||
}
|
||||
|
||||
orderNo = order.OrderNo
|
||||
return nil
|
||||
}
|
||||
|
||||
product, err3 := v.ProductRepo.GetByProductNo(bizCtx, req.ProductNo)
|
||||
if err3 != nil {
|
||||
return err3
|
||||
}
|
||||
|
||||
product, err := v.ProductRepo.GetByProductNo(bizCtx, req.ProductNo)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
order, err := v.order(bizCtx, req, product)
|
||||
if err != nil {
|
||||
return err
|
||||
order, err3 = v.order(bizCtx, req, product)
|
||||
if err3 != nil {
|
||||
return err3
|
||||
}
|
||||
|
||||
orderNo = order.OrderNo
|
||||
|
|
|
|||
Loading…
Reference in New Issue