|
@@ -36,7 +36,7 @@ func (t *TaskSchedule) AddTask(msg []byte) error {
|
|
newJson := gjson.New(task.Actions)
|
|
newJson := gjson.New(task.Actions)
|
|
server.Log.Debugf("add task: taskId:%s,corn:%s,actions:%s", task.TaskId, task.Cron, newJson.MustToJsonString())
|
|
server.Log.Debugf("add task: taskId:%s,corn:%s,actions:%s", task.TaskId, task.Cron, newJson.MustToJsonString())
|
|
// 创建任务
|
|
// 创建任务
|
|
- entity, err := t.cron.Add(context.Background(), task.Cron, func(ctx context.Context) {
|
|
|
|
|
|
+ entity, err := t.cron.AddTimes(context.Background(), task.Cron, task.Times, func(ctx context.Context) {
|
|
if err = NewTaskExecutor(task.Actions).Do(); err != nil {
|
|
if err = NewTaskExecutor(task.Actions).Do(); err != nil {
|
|
server.Log.Errorf("do taskid :%s error:%s", task.TaskId, err.Error())
|
|
server.Log.Errorf("do taskid :%s error:%s", task.TaskId, err.Error())
|
|
}
|
|
}
|