Merge pull request #2742 from fuweid/bugfix_return_context_cancel_error_during_subcribe

bugfix: return the context error during event subscribe
This commit is contained in:
Derek McGowan 2018-10-24 16:13:41 -07:00 committed by GitHub
commit c20c569a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,9 @@ func (e *eventRemote) Subscribe(ctx context.Context, filters ...string) (ch <-ch
Event: ev.Event,
}:
case <-ctx.Done():
if cerr := ctx.Err(); cerr != context.Canceled {
errq <- cerr
}
return
}
}