diff options
author | Wim <wim@42.be> | 2019-02-26 17:08:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-26 17:08:20 +0100 |
commit | 740b5f260243bd95ed83c6cfc805543e5d87b5e8 (patch) | |
tree | dccec542c93cdb4e52cb8c602df41900019aed1c /bridge | |
parent | 96841c70c7d59d1c80f98db7dcdfc03620829758 (diff) | |
download | matterbridge-msglm-740b5f260243bd95ed83c6cfc805543e5d87b5e8.tar.gz matterbridge-msglm-740b5f260243bd95ed83c6cfc805543e5d87b5e8.tar.bz2 matterbridge-msglm-740b5f260243bd95ed83c6cfc805543e5d87b5e8.zip |
Keep reconnecting until succeed (zulip) (#737)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/zulip/zulip.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bridge/zulip/zulip.go b/bridge/zulip/zulip.go index 89c3b059..77bb7e7e 100644 --- a/bridge/zulip/zulip.go +++ b/bridge/zulip/zulip.go @@ -116,11 +116,13 @@ func (b *Bzulip) handleQueue() error { case gzb.BadEventQueueError: b.Log.Info("got a bad event queue id error, reconnecting") b.bot.Queues = nil - b.q, err = b.bot.RegisterAll() - if err != nil { - b.Log.Errorf("reconnecting failed: %s. Sleeping 10 seconds", err) - time.Sleep(time.Second * 10) - continue + for { + b.q, err = b.bot.RegisterAll() + if err != nil { + b.Log.Errorf("reconnecting failed: %s. Sleeping 10 seconds", err) + time.Sleep(time.Second * 10) + } + break } case gzb.HeartbeatError: b.Log.Debug("heartbeat received.") |