From f4e908feb320ea66bfeea93317872e4e55bd603c Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 22 Dec 2023 12:08:51 +0100 Subject: [PATCH] Update websocket backoff behoviour --- agent/bitwarden/websocket.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/bitwarden/websocket.go b/agent/bitwarden/websocket.go index 42ccfdf..5330a01 100644 --- a/agent/bitwarden/websocket.go +++ b/agent/bitwarden/websocket.go @@ -52,10 +52,10 @@ const ( ) func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Config) { + time.Sleep(5 * time.Second) for { - time.Sleep(WEBSOCKET_SLEEP_DURATION_SECONDS * time.Second) - if cfg.IsLocked() { + time.Sleep(5 * time.Second) continue } @@ -65,6 +65,8 @@ func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Con websocketLog.Error("Websocket error %s", err) } } + + time.Sleep(WEBSOCKET_SLEEP_DURATION_SECONDS * time.Second) } }