Skip to content

Commit

Permalink
fix result handling for foreground task in run_task_background
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Sep 14, 2024
1 parent c8cea3b commit e4ceb59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/coordinator/tasks/run_task_background/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e4ceb59

Please sign in to comment.