From 37e000a53e77e83856501424c45291caa93d285b Mon Sep 17 00:00:00 2001 From: Gareth George Date: Tue, 26 Dec 2023 08:33:40 +0000 Subject: [PATCH] fix: operations associated with incorrect ID when tasks are rescheduled --- internal/orchestrator/tasks.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/orchestrator/tasks.go b/internal/orchestrator/tasks.go index 8d1e4878..a0418099 100644 --- a/internal/orchestrator/tasks.go +++ b/internal/orchestrator/tasks.go @@ -54,6 +54,9 @@ func (t *TaskWithOperation) runWithOpAndContext(ctx context.Context, do func(ctx t.running.Store(true) defer t.running.Store(false) + defer func() { + t.op = nil + }() return WithOperation(t.orch.OpLog, t.op, func() error { return do(ctx, t.op)