Skip to content

Commit 2d9dc66

Browse files
committed
disable reconnect attempt limit and increase interval
1 parent db4d970 commit 2d9dc66

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/js/app.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ function init_websocket(attempts=1) {
2222
websocket_connection.close();
2323
websocket_connection = null;
2424
}
25-
if(attempts >= 2) {
26-
const el = document.querySelector('body');
27-
const alert = document.createElement('div');
28-
alert.classList.add('alert', 'alert-danger', 'text-center', 'm-3');
29-
alert.textContent = 'Услугата е временно недостъпна. Моля опитайте по-късно.';
30-
el.innerHTML = '';
31-
el.appendChild(alert);
32-
return;
33-
}
25+
// if(attempts >= 2) {
26+
// const el = document.querySelector('body');
27+
// const alert = document.createElement('div');
28+
// alert.classList.add('alert', 'alert-danger', 'text-center', 'm-3');
29+
// alert.textContent = 'Услугата е временно недостъпна. Моля опитайте по-късно.';
30+
// el.innerHTML = '';
31+
// el.appendChild(alert);
32+
// return;
33+
// }
3434
websocket_connection = new WebSocket(WEBSOCKET_URL);
3535
websocket_connection.onmessage = ev => {
3636
let data = JSON.parse(ev.data);
@@ -61,7 +61,7 @@ function init_websocket(attempts=1) {
6161
apply_filters();
6262
};
6363
websocket_connection.onerror = () => {
64-
setTimeout(() => init_websocket(attempts + 1), 1000);
64+
setTimeout(() => init_websocket(attempts + 1), 2500);
6565
}
6666
}
6767

0 commit comments

Comments
 (0)