fix: 解决删除网站导致的数据库锁库问题

This commit is contained in:
zhengkunwang223
2022-12-21 15:54:34 +08:00
parent 94ebe4952a
commit 0a8bf98ee9
12 changed files with 66 additions and 57 deletions

View File

@@ -1,6 +1,7 @@
package v1
import (
"context"
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/backend/app/dto"
"github.com/1Panel-dev/1Panel/backend/constant"
@@ -18,7 +19,7 @@ func (b *BaseApi) CreateMysql(c *gin.Context) {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
return
}
if err := mysqlService.Create(req); err != nil {
if _, err := mysqlService.Create(context.Background(), req); err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}