From 9fac51f8c7e4524f04c066cde53d617d285f585c Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 8 Feb 2021 17:43:42 +0100 Subject: [PATCH] outpost: downgrade recws for now see https://github.com/recws-org/recws/issues/29 --- outpost/go.mod | 2 +- outpost/pkg/ak/api_ws.go | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/outpost/go.mod b/outpost/go.mod index d1c621008..8e7413075 100644 --- a/outpost/go.mod +++ b/outpost/go.mod @@ -24,7 +24,7 @@ require ( github.com/pelletier/go-toml v1.8.1 // indirect github.com/pkg/errors v0.9.1 github.com/pquerna/cachecontrol v0.0.0-20200819021114-67c6ae64274f // indirect - github.com/recws-org/recws v1.2.2 + github.com/recws-org/recws v1.2.1 github.com/sirupsen/logrus v1.7.0 github.com/spf13/afero v1.5.1 // indirect github.com/spf13/cast v1.3.1 // indirect diff --git a/outpost/pkg/ak/api_ws.go b/outpost/pkg/ak/api_ws.go index b1286150c..93eace7f3 100644 --- a/outpost/pkg/ak/api_ws.go +++ b/outpost/pkg/ak/api_ws.go @@ -69,23 +69,10 @@ func (ac *APIController) Shutdown() { } func (ac *APIController) startWSHandler() { - notConnectedBackoff := 1 logger := ac.logger.WithField("loop", "ws-handler") for { if !ac.wsConn.IsConnected() { - notConnectedWait := time.Duration(notConnectedBackoff) * time.Second - 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)