This commit is contained in:
parent
90d03a07bc
commit
526634aee3
|
|
@ -91,15 +91,15 @@ func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, t vo.OrderType, outBi
|
|||
|
||||
if tx.Error != nil {
|
||||
|
||||
if errors.Is(tx.Error, gorm.ErrRecordNotFound) {
|
||||
return nil, err2.ErrorDbNotFound("订单数据不存在")
|
||||
}
|
||||
|
||||
if errors.Is(tx.Error, context.DeadlineExceeded) {
|
||||
sqlDB, _ := db.DB()
|
||||
log.Warnf("order当前打开连接数:%d,空闲连接数:%d", sqlDB.Stats().OpenConnections, sqlDB.Stats().Idle)
|
||||
}
|
||||
|
||||
if errors.Is(tx.Error, gorm.ErrRecordNotFound) {
|
||||
return nil, err2.ErrorDbNotFound("订单数据不存在")
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("order db fail %w", tx.Error)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue