mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-04-02 18:55:19 +08:00
fix: 前端树形按钮变更为右击显示,后端修复协程panic导致进程退出
This commit is contained in:
@@ -117,6 +117,15 @@ func (d *Db) ExecSqlFile(rc *ctx.ReqCtx) {
|
||||
dbId := GetDbId(g)
|
||||
|
||||
go func() {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
switch t := err.(type) {
|
||||
case *biz.BizError:
|
||||
d.MsgApp.CreateAndSend(rc.LoginAccount, ws.ErrMsg("sql脚本执行失败", fmt.Sprintf("[%s]执行失败: [%s]", filename, t.Error())))
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
db := d.DbApp.GetDbInstance(dbId)
|
||||
for _, sql := range sqls {
|
||||
sql = strings.Trim(sql, " ")
|
||||
|
||||
Reference in New Issue
Block a user