diff --git a/pkg/coordinator/tasks/run_task_background/task.go b/pkg/coordinator/tasks/run_task_background/task.go index fa571b72..5861bccc 100644 --- a/pkg/coordinator/tasks/run_task_background/task.go +++ b/pkg/coordinator/tasks/run_task_background/task.go @@ -190,12 +190,13 @@ func (t *Task) execForegroundTask(ctx context.Context) { }() taskState := t.ctx.Scheduler.GetTaskState(t.foregroundTask) - taskResult := taskState.GetTaskStatus() err := t.ctx.Scheduler.ExecuteTask(ctx, t.foregroundTask, func(ctx context.Context, _ context.CancelFunc, _ types.TaskIndex) { t.watchTaskResult(ctx, taskState) }) + taskResult := taskState.GetTaskStatus() + taskStatus := "success" if taskResult.Result == types.TaskResultFailure { taskStatus = "failure"