From 92f136657450a65452e5b39fb5cb79a670607753 Mon Sep 17 00:00:00 2001 From: matty Date: Fri, 4 Jul 2025 23:55:51 +0000 Subject: [PATCH] I don't think the websocket thing is gonna work. --- src/main.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index b35c494..db03e3b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -182,6 +182,7 @@ ws.on("close", (event: CloseEvent) => { ); ws = reconnect(ws); if (ws.readyState === WebSocket.OPEN) { + console.log(`Reconnection to ${process.env.PLEROMA_INSTANCE_DOMAIN} successful.`) return; } reconnectAttempts++; @@ -207,13 +208,10 @@ ws.on("open", () => { reconnectAttempts = 0; setInterval(() => { ws.send(JSON.stringify({ type: "ping" })); - console.log("Sending ping to keep session alive..."); + // console.log("Sending ping to keep session alive..."); }, 20000); }); -ws.on("pong", (data) => { - console.log(`Pong received: ${JSON.stringify(data.toString("utf-8"))}`); -}); ws.on("message", async (data) => { try { @@ -229,6 +227,6 @@ ws.on("message", async (data) => { await postReplyToStatus(payload, ollamaResponse); } } catch (error: any) { - console.error(error.message); + throw new Error(error.message); } });