Fix websocket sometimes not connecting

This commit is contained in:
Bernd Schoolmann 2023-12-28 14:48:42 +01:00
parent 4c8fb1d2ab
commit 76694b5fdf
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)
}
}
}()