Update websocket backoff behaviour

This commit is contained in:
Bernd Schoolmann 2023-12-22 12:09:50 +01:00
parent 189b1511f8
commit ebe3dd44b5
No known key found for this signature in database
1 changed files with 4 additions and 2 deletions

View File

@ -52,10 +52,10 @@ const (
) )
func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Config) { func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Config) {
time.Sleep(5 * time.Second)
for { for {
time.Sleep(WEBSOCKET_SLEEP_DURATION_SECONDS * time.Second)
if cfg.IsLocked() { if cfg.IsLocked() {
time.Sleep(5 * time.Second)
continue continue
} }
@ -65,6 +65,8 @@ func RunWebsocketDaemon(ctx context.Context, vault *vault.Vault, cfg *config.Con
websocketLog.Error("Websocket error %s", err) websocketLog.Error("Websocket error %s", err)
} }
} }
time.Sleep(WEBSOCKET_SLEEP_DURATION_SECONDS * time.Second)
} }
} }