From ea2c7d2f365f8b2860f2222e4c2ab63fa419458f Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 5 Feb 2024 15:17:37 -0600 Subject: [PATCH] Make websocket retry longer --- resources/event.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/event.js b/resources/event.js index e9beb68..73f9302 100644 --- a/resources/event.js +++ b/resources/event.js @@ -7,6 +7,7 @@ function EventReceiver(websocket, poller, channels, last_msg, onmessage) { if (onmessage) this.onmessage = onmessage; var receiver = this; + var time_retry = 1000; function init_poll() { function long_poll() { @@ -62,7 +63,8 @@ function EventReceiver(websocket, poller, channels, last_msg, onmessage) { if (event.code != 1000 && receiver.onwsclose !== null) receiver.onwsclose(event); if (event.code == 1006) { - setTimeout(connect, 1000); + setTimeout(connect, time_retry); + time_retry += 2000; } } }