This commit is contained in:
wailovet
2024-06-13 22:21:10 +08:00
parent 8b938ad862
commit b87f3f104f
+15 -15
View File
@@ -47,21 +47,21 @@ async function waitMessage() {
console.log("Connection error", event);
};
for (;;) {
await sleep(1000);
try {
if (websocket.readyState !== WebSocket.OPEN) {
return;
}
websocket.send(
JSON.stringify({
type: "ping",
})
);
} catch (error) {
return;
}
}
// for (;;) {
// await sleep(1000);
// try {
// if (websocket.readyState !== WebSocket.OPEN) {
// return;
// }
// websocket.send(
// JSON.stringify({
// type: "ping",
// })
// );
// } catch (error) {
// return;
// }
// }
}
/**