forked from platypush/platypush
Reconnect to the websocket immediately in case of normal closure
This commit is contained in:
parent
d380e0f398
commit
ce5db9a9c6
1 changed files with 2 additions and 1 deletions
|
@ -33,7 +33,8 @@ $(document).ready(function() {
|
||||||
console.log('Websocket closed, code: ' + event.code);
|
console.log('Websocket closed, code: ' + event.code);
|
||||||
websocketReconnectInterval = setInterval(function() {
|
websocketReconnectInterval = setInterval(function() {
|
||||||
initWebsocket();
|
initWebsocket();
|
||||||
}, 5000);
|
}, event.code == 1000 ? 10 : 5000); // Reconnect immediately in case of normal websocket closure
|
||||||
|
// otherwise wait 5 seconds
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue