mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-04-09 05:55:18 +08:00
fix: 数据库迁移、同步保存时定时任务未清除问题
This commit is contained in:
@@ -71,7 +71,13 @@ func (app *dataSyncAppImpl) Save(ctx context.Context, taskEntity *entity.DataSyn
|
||||
taskEntity.TaskKey = uuid.New().String()
|
||||
err = app.Insert(ctx, taskEntity)
|
||||
} else {
|
||||
taskEntity.TaskKey = ""
|
||||
if taskEntity.TaskKey == "" {
|
||||
task, err := app.GetById(taskEntity.Id)
|
||||
if err != nil {
|
||||
return errorx.NewBiz("db sync task not found")
|
||||
}
|
||||
taskEntity.TaskKey = task.TaskKey
|
||||
}
|
||||
err = app.UpdateById(ctx, taskEntity)
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user