File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,17 @@ func (r *Run) request(ctx context.Context, payload any) (err error) {
244
244
245
245
r .events = make (chan Frame , 100 )
246
246
r .lock .Lock ()
247
+
248
+ r .wait = func () {
249
+ <- cancelCtx .Done ()
250
+ if err := context .Cause (cancelCtx ); ! errors .Is (err , context .Canceled ) && r .err == nil {
251
+ r .state = Error
252
+ r .err = err
253
+ } else if r .state != Continue && r .state != Error {
254
+ r .state = Finished
255
+ }
256
+ }
257
+
247
258
go func () {
248
259
var (
249
260
err error
@@ -385,16 +396,6 @@ func (r *Run) request(ctx context.Context, payload any) (err error) {
385
396
}
386
397
}()
387
398
388
- r .wait = func () {
389
- <- cancelCtx .Done ()
390
- if err := context .Cause (cancelCtx ); ! errors .Is (err , context .Canceled ) && r .err == nil {
391
- r .state = Error
392
- r .err = err
393
- } else if r .state != Continue && r .state != Error {
394
- r .state = Finished
395
- }
396
- }
397
-
398
399
return nil
399
400
}
400
401
You can’t perform that action at this time.
0 commit comments