From e4ceb59f91edf64a7504af18c8825e3635661186 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 14 Sep 2024 20:02:37 +0200 Subject: [PATCH] fix result handling for foreground task in `run_task_background` --- pkg/coordinator/tasks/run_task_background/task.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"