Skip to content

Commit df39a81

Browse files
committed
task graph: simplify code
We only start draining `workCh` when canceled (`ctx.Done()`). We never submit more work once canceled so reseting `submitted` record is useless
1 parent 1c71a50 commit df39a81

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/payload/task_graph.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,8 @@ func RunGraph(ctx context.Context, graph *TaskGraph, maxParallelism int, fn func
514514
inflight--
515515
case <-ctx.Done():
516516
select {
517-
case runTask := <-workCh: // workers canceled, so remove any work from the queue ourselves
517+
case <-workCh: // workers canceled, so remove any work from the queue ourselves
518518
inflight--
519-
submitted[runTask.index] = false
520519
default:
521520
}
522521
}

0 commit comments

Comments
 (0)