满足压测处理

This commit is contained in:
李子铭 2025-03-21 15:14:00 +08:00
parent bab72020ad
commit a91114d8ae
1 changed files with 17 additions and 21 deletions

View File

@ -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 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 {
return err
}
if err4 := v.orderRetry(bizCtx, order); err4 != nil {
return err4
}
orderNo = order.OrderNo
return nil
}
orderNo = order.OrderNo
return nil
}
product, err := v.ProductRepo.GetByProductNo(bizCtx, req.ProductNo)
if err != nil {
return err
product, err3 := v.ProductRepo.GetByProductNo(bizCtx, req.ProductNo)
if err3 != nil {
return err3
}
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