File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,8 @@ You can now check what blocks have been created by:
342
342
},
343
343
PostRun : map [cmds.EncodingType ]func (cmds.Request , cmds.ResponseEmitter ) cmds.ResponseEmitter {
344
344
cmds .CLI : func (req cmds.Request , re cmds.ResponseEmitter ) cmds.ResponseEmitter {
345
+ ctx := req .Context ()
346
+
345
347
reNext , res := cmds .NewChanResponsePair (req )
346
348
outChan := make (chan interface {})
347
349
@@ -429,9 +431,6 @@ You can now check what blocks have been created by:
429
431
bar .ShowBar = true
430
432
bar .ShowTimeLeft = true
431
433
}
432
- case <- req .Context ().Done ():
433
- re .SetError (req .Context ().Err (), cmdkit .ErrNormal )
434
- return
435
434
}
436
435
}
437
436
}
@@ -469,7 +468,12 @@ You can now check what blocks have been created by:
469
468
return
470
469
}
471
470
472
- outChan <- v
471
+ select {
472
+ case outChan <- v :
473
+ case <- ctx .Done ():
474
+ re .SetError (ctx .Err (), cmdkit .ErrNormal )
475
+ return
476
+ }
473
477
}
474
478
}()
475
479
You can’t perform that action at this time.
0 commit comments