parent
f5a1158e64
commit
a80abffc26
|
|
@ -29,6 +29,7 @@ import (
|
||||||
"github.com/RichardKnop/machinery/v2/log"
|
"github.com/RichardKnop/machinery/v2/log"
|
||||||
"github.com/RichardKnop/machinery/v2/tasks"
|
"github.com/RichardKnop/machinery/v2/tasks"
|
||||||
"github.com/RichardKnop/machinery/v2/utils"
|
"github.com/RichardKnop/machinery/v2/utils"
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
|
|
||||||
irevoker "git.ifooth.com/common/pkg/task/revokers/iface"
|
irevoker "git.ifooth.com/common/pkg/task/revokers/iface"
|
||||||
|
|
@ -290,6 +291,8 @@ func (m *TaskManager) registerScheduleTask(spec string, task *types.Task) error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 定时任务每次生成新的任务ID
|
||||||
|
task.TaskID = uuid.NewString()
|
||||||
err = m.Dispatch(task)
|
err = m.Dispatch(task)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ERROR.Printf("periodic task failed. task name is: %s. error is %s", task.TaskName, err.Error())
|
log.ERROR.Printf("periodic task failed. task name is: %s. error is %s", task.TaskName, err.Error())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue