From 95cf57744726b860533481cc2362a47a4bfbf462 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 12 Jun 2021 12:02:36 -0700 Subject: [PATCH] fix(lotus-sim): really cancel walk immediately --- cmd/lotus-sim/simulation/simulation.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-sim/simulation/simulation.go b/cmd/lotus-sim/simulation/simulation.go index ef4278178..0b8ab1e56 100644 --- a/cmd/lotus-sim/simulation/simulation.go +++ b/cmd/lotus-sim/simulation/simulation.go @@ -401,12 +401,11 @@ func (sim *Simulation) Walk( grp.Go(func() error { qs := resultQs for len(qs) > 0 { - if err := ctx.Err(); err != nil { - return ctx.Err() - } - newQs := qs[:0] for _, q := range qs { + if err := ctx.Err(); err != nil { + return ctx.Err() + } select { case r, ok := <-q: if !ok {