From a28b24e4c5a7e3c152e204edb3189c63c5532816 Mon Sep 17 00:00:00 2001 From: luke-lombardi <33990301+luke-lombardi@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:55:34 -0500 Subject: [PATCH] fix task cancellation status bug --- pkg/abstractions/taskqueue/task.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/abstractions/taskqueue/task.go b/pkg/abstractions/taskqueue/task.go index 86b9e559b..06df80456 100644 --- a/pkg/abstractions/taskqueue/task.go +++ b/pkg/abstractions/taskqueue/task.go @@ -70,6 +70,11 @@ func (t *TaskQueueTask) Cancel(ctx context.Context, reason types.TaskCancellatio return err } + // Don't update tasks that are already in a terminal state + if task.Status.IsCompleted() { + return nil + } + switch reason { case types.TaskExpired: task.Status = types.TaskStatusExpired