This commit is contained in:
李子铭 2025-03-21 09:17:16 +08:00
parent 90d03a07bc
commit 526634aee3
1 changed files with 4 additions and 4 deletions

View File

@ -91,15 +91,15 @@ func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, t vo.OrderType, outBi
if tx.Error != nil { if tx.Error != nil {
if errors.Is(tx.Error, gorm.ErrRecordNotFound) {
return nil, err2.ErrorDbNotFound("订单数据不存在")
}
if errors.Is(tx.Error, context.DeadlineExceeded) { if errors.Is(tx.Error, context.DeadlineExceeded) {
sqlDB, _ := db.DB() sqlDB, _ := db.DB()
log.Warnf("order当前打开连接数:%d,空闲连接数:%d", sqlDB.Stats().OpenConnections, sqlDB.Stats().Idle) 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) return nil, fmt.Errorf("order db fail %w", tx.Error)
} }