mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
!110 feat: 支持各源数据库导出sql,数据库迁移部分bug修复
* feat: 各源数据库导出 * fix: 数据库迁移 bug修复
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"mayfly-go/pkg/req"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type DbTransferTask struct {
|
||||
@@ -53,13 +54,14 @@ func (d *DbTransferTask) DeleteTask(rc *req.Ctx) {
|
||||
}
|
||||
|
||||
func (d *DbTransferTask) Run(rc *req.Ctx) {
|
||||
start := time.Now()
|
||||
taskId := d.changeState(rc, entity.DbTransferTaskRunStateRunning)
|
||||
go d.DbTransferTask.Run(taskId, func(msg string, err error) {
|
||||
// 修改状态为停止
|
||||
if err != nil {
|
||||
logx.Error(msg, err)
|
||||
} else {
|
||||
logx.Info(fmt.Sprintf("执行迁移完成,%s", msg))
|
||||
logx.Info(fmt.Sprintf("执行迁移完成,%s, 耗时:%v", msg, time.Since(start)))
|
||||
}
|
||||
// 修改任务状态
|
||||
task := new(entity.DbTransferTask)
|
||||
|
||||
Reference in New Issue
Block a user