Add reconnectDelay variable for WebSocket reconnection logic

This commit is contained in:
MayaTheShy
2026-03-22 02:38:35 -04:00
parent 460cf34252
commit 4045def0a7

View File

@@ -29,6 +29,7 @@ function newCommandId() {
let _httpPollTimer = null;
let _wsHealthTimer = null;
let _lastWsMessage = 0;
let _reconnectDelay = 1000;
const HTTP_POLL_INTERVAL = 10_000; // Poll HTTP every 10 s as fallback
const WS_STALE_TIMEOUT = 35_000; // If no WS message for 35 s → reconnect