Fix issues after refactor

Relates to #126
This commit is contained in:
Mickael Remond
2019-11-08 12:07:55 +01:00
parent 47976624c9
commit 6aa1e668ee
6 changed files with 29 additions and 8 deletions

View File

@@ -86,9 +86,12 @@ func (sm *StreamManager) Run() error {
case StateStreamError:
sm.client.Disconnect()
// Only try reconnecting if we have not been kicked by another session to avoid connection loop.
// TODO: Make this conflict exception a permanent error
if e.StreamError != "conflict" {
sm.connect()
}
case StatePermanentError:
// Do not attempt to reconnect
}
}
sm.client.SetHandler(handler)