From 76694b5fdff46ce1c73f04decaea20fde8dcb0db Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Thu, 28 Dec 2023 14:48:42 +0100 Subject: [PATCH] Fix websocket sometimes not connecting --- agent/bitwarden/websocket.go | 1 - agent/unixsocketagent.go | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/bitwarden/websocket.go b/agent/bitwarden/websocket.go index 9b1db9f..68c603f 100644 --- a/agent/bitwarden/websocket.go +++ b/agent/bitwarden/websocket.go @@ -52,7 +52,6 @@ const ( ) func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Config) { - time.Sleep(5 * time.Second) for { if cfg.IsLocked() { time.Sleep(5 * time.Second) diff --git a/agent/unixsocketagent.go b/agent/unixsocketagent.go index 6a8ef70..292271c 100644 --- a/agent/unixsocketagent.go +++ b/agent/unixsocketagent.go @@ -195,8 +195,9 @@ func StartUnixAgent(path string, runtimeConfig config.RuntimeConfig) error { // polling, switch this to signal based later if !cfg.IsLocked() && cfg.IsLoggedIn() { bitwarden.RunWebsocketDaemon(ctx, vault, &cfg) + time.Sleep(60 * time.Second) } - time.Sleep(60 * time.Second) + time.Sleep(1 * time.Second) } } }()