fix(lotus-sim): really cancel walk immediately

This commit is contained in:
Steven Allen 2021-06-12 12:02:36 -07:00
parent 8fffaa5c47
commit 95cf577447

View File

@ -401,12 +401,11 @@ func (sim *Simulation) Walk(
grp.Go(func() error { grp.Go(func() error {
qs := resultQs qs := resultQs
for len(qs) > 0 { for len(qs) > 0 {
if err := ctx.Err(); err != nil {
return ctx.Err()
}
newQs := qs[:0] newQs := qs[:0]
for _, q := range qs { for _, q := range qs {
if err := ctx.Err(); err != nil {
return ctx.Err()
}
select { select {
case r, ok := <-q: case r, ok := <-q:
if !ok { if !ok {