Skip to content

Commit

Permalink
Update websocket.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhashBose authored Sep 12, 2023
1 parent 91d719c commit 49cbcd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions webui/js/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ function reconnectWebsocket () {
ws.addEventListener('close', websocketOnClose)
}

function heartbeat() {
if (window.ws && window.ws.readyState == 1)
window.ws.send("heartbeat");
setTimeout(heartbeat, 30000);
}
heartbeat()

function websocketOnOpen (evt) {
window.websocketAvailable = true

Expand Down

0 comments on commit 49cbcd0

Please sign in to comment.