From 886499b4fb804e295c47877b7f17775cd965c99a Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 21 Sep 2021 15:27:48 -0700 Subject: [PATCH] zulip: Treat unknown errors with a 10-second backoff. An unknown error (including an unauthorized error) would fall through with no calls to time.Sleep, resulting in hammering the server as quickly as possible. Add a 10-second sleep in the default error case. The heartbeat is left with no explicit sleep, but all other codepaths now contain one. --- bridge/zulip/zulip.go | 1 + 1 file changed, 1 insertion(+) diff --git a/bridge/zulip/zulip.go b/bridge/zulip/zulip.go index e66558a2..4becbdc4 100644 --- a/bridge/zulip/zulip.go +++ b/bridge/zulip/zulip.go @@ -125,6 +125,7 @@ func (b *Bzulip) handleQueue() error { b.Log.Debug("heartbeat received.") default: b.Log.Debugf("receiving error: %#v", err) + time.Sleep(time.Second * 10) } if err != nil { continue