From 024e75794a4c8da4af2e046b885cb0fc123ec525 Mon Sep 17 00:00:00 2001 From: John Starich Date: Wed, 21 Aug 2024 17:05:10 -0500 Subject: [PATCH] Skip processing on closed result channel, fix panic --- execute.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/execute.go b/execute.go index f98af80..e1933e5 100644 --- a/execute.go +++ b/execute.go @@ -94,7 +94,10 @@ func (executor *ParallelExecutor) Execute(ctx *ExecutionContext) (map[string]int for { select { // we have a new result - case payload := <-resultCh: + case payload, ok := <-resultCh: + if !ok { + return + } ctx.logger.Debug("Inserting result into ", payload.InsertionPoint) ctx.logger.Debug("Result: ", payload.Result)