fixes from my own review

This commit is contained in:
Anton Kaliaev
2017-10-27 00:01:00 +03:00
parent f6539737de
commit 1c1c68df8d
5 changed files with 26 additions and 14 deletions

View File

@@ -291,9 +291,10 @@ func (w *WSEvents) UnsubscribeAll(ctx context.Context) error {
// After being reconnected, it is necessary to redo subscription to server
// otherwise no data will be automatically received.
func (w *WSEvents) redoSubscriptions() {
for query, out := range w.subscriptions {
// NOTE: no timeout for reconnect
w.Subscribe(context.Background(), query, out)
for query := range w.subscriptions {
// NOTE: no timeout for resubscribing
// FIXME: better logging/handling of errors??
w.ws.Subscribe(context.Background(), query)
}
}