From 0736047487b0205bde1a72330947d8e362c58879 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Tue, 18 Nov 2025 22:20:38 +0000 Subject: [PATCH] Update frontend/local-client-cli/src/cli.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- frontend/local-client-cli/src/cli.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/local-client-cli/src/cli.ts b/frontend/local-client-cli/src/cli.ts index b0ce096e..2655bd38 100644 --- a/frontend/local-client-cli/src/cli.ts +++ b/frontend/local-client-cli/src/cli.ts @@ -138,11 +138,15 @@ async function main(): Promise { if (args.health !== undefined) { const healthFile = args.health; - setInterval(() => { + const healthInterval = setInterval(() => { void client.checkConnection().then((status) => { writeHealthStatus(healthFile, status); }); }, 30 * 1000); // every 30 seconds + const clearHealthInterval = () => clearInterval(healthInterval); + process.on("SIGINT", clearHealthInterval); + process.on("SIGTERM", clearHealthInterval); + process.on("exit", clearHealthInterval); } // Add colored log formatter with level filtering