fix(lotus-sim): really cancel walk immediately
This commit is contained in:
parent
8fffaa5c47
commit
95cf577447
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user