Skip to content

Commit 634cff6

Browse files
authored
Skip processing on closed result channel, fix panic (#215)
1 parent 6496791 commit 634cff6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

execute.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ func (executor *ParallelExecutor) Execute(ctx *ExecutionContext) (map[string]int
9494
for {
9595
select {
9696
// we have a new result
97-
case payload := <-resultCh:
97+
case payload, ok := <-resultCh:
98+
if !ok {
99+
return
100+
}
98101
ctx.logger.Debug("Inserting result into ", payload.InsertionPoint)
99102
ctx.logger.Debug("Result: ", payload.Result)
100103

0 commit comments

Comments
 (0)