Browse Source

check for error when stopping WSClient

pull/807/head
Anton Kaliaev 7 years ago
parent
commit
c6b2334fa3
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      rpc/lib/client/ws_client.go

+ 5
- 3
rpc/lib/client/ws_client.go View File

@ -170,9 +170,11 @@ func (c *WSClient) OnStop() {}
// channel is closed.
func (c *WSClient) Stop() error {
err := c.BaseService.Stop()
// only close user-facing channels when we can't write to them
c.wg.Wait()
close(c.ResponsesCh)
if err == nil {
// only close user-facing channels when we can't write to them
c.wg.Wait()
close(c.ResponsesCh)
}
return err
}


Loading…
Cancel
Save