5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 18:40:25 +00:00

Keep reconnecting until succeed (zulip) (#737)

This commit is contained in:
Wim 2019-02-26 17:08:20 +01:00 committed by GitHub
parent 96841c70c7
commit 740b5f2602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,11 +116,13 @@ func (b *Bzulip) handleQueue() error {
case gzb.BadEventQueueError: case gzb.BadEventQueueError:
b.Log.Info("got a bad event queue id error, reconnecting") b.Log.Info("got a bad event queue id error, reconnecting")
b.bot.Queues = nil b.bot.Queues = nil
b.q, err = b.bot.RegisterAll() for {
if err != nil { b.q, err = b.bot.RegisterAll()
b.Log.Errorf("reconnecting failed: %s. Sleeping 10 seconds", err) if err != nil {
time.Sleep(time.Second * 10) b.Log.Errorf("reconnecting failed: %s. Sleeping 10 seconds", err)
continue time.Sleep(time.Second * 10)
}
break
} }
case gzb.HeartbeatError: case gzb.HeartbeatError:
b.Log.Debug("heartbeat received.") b.Log.Debug("heartbeat received.")