Merge branch 'master' into version-2021.2

This commit is contained in:
Jens Langhammer
2021-02-07 19:04:37 +01:00
43 changed files with 3333 additions and 1126 deletions

View File

@ -77,7 +77,15 @@ func (ac *APIController) startWSHandler() {
logger.WithField("wait", notConnectedWait).Info("Not connected, trying again...")
time.Sleep(notConnectedWait)
notConnectedBackoff += notConnectedBackoff
// Limit backoff to max 60 seconds
if notConnectedBackoff >= 60 {
notConnectedBackoff = 60
}
ac.wsConn.CloseAndReconnect()
continue
} else {
// When we're connected, reset backoff to 1
notConnectedBackoff = 1
}
var wsMsg websocketMessage
err := ac.wsConn.ReadJSON(&wsMsg)
@ -109,7 +117,7 @@ func (ac *APIController) startWSHealth() {
},
}
err := ac.wsConn.WriteJSON(aliveMsg)
ac.logger.WithField("loop", "ws-health").Debug("hello'd")
ac.logger.WithField("loop", "ws-health").Trace("hello'd")
if err != nil {
ac.logger.WithField("loop", "ws-health").Println("write:", err)
ac.wsConn.CloseAndReconnect()