From 2fd1fd9573c4e297ecbc45a0be184450fb034f75 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 16 Nov 2017 20:19:52 +0100 Subject: [PATCH] Break when re-login fails (mattermost) --- matterclient/matterclient.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 0b5f0a07..e43fd223 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -817,9 +817,14 @@ func (m *MMClient) StatusLoop() { backoff = time.Second * 60 case <-time.After(time.Second * 5): if retries > 3 { + m.log.Debug("StatusLoop() timeout") m.Logout() m.WsQuit = false - m.Login() + err := m.Login() + if err != nil { + log.Errorf("Login failed: %#v", err) + break + } if m.OnWsConnect != nil { m.OnWsConnect() }