fix: 解决删除数据库过程中导致的锁库
This commit is contained in:

committed by
zhengkunwang223

parent
aa9f6f0f2b
commit
f8409fbfaf
@@ -227,10 +227,13 @@ func (b *BaseApi) DeleteMysql(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := mysqlService.Delete(req); err != nil {
|
||||
tx, ctx := helper.GetTxAndContext()
|
||||
if err := mysqlService.Delete(ctx, req); err != nil {
|
||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
tx.Commit()
|
||||
helper.SuccessWithData(c, nil)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user