Improve settings #168

Merged
schmelczer merged 14 commits from asch/explore into main 2025-11-19 19:53:10 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit 7bb7765c84 - Show all commits
Andras Schmelczer 2025-11-18 22:26:53 +00:00

View file

@ -143,7 +143,9 @@ async function main(): Promise<void> {
writeHealthStatus(healthFile, status); writeHealthStatus(healthFile, status);
}); });
}, 30 * 1000); // every 30 seconds }, 30 * 1000); // every 30 seconds
const clearHealthInterval = () => clearInterval(healthInterval); const clearHealthInterval = (): void => {
clearInterval(healthInterval);
};
process.on("SIGINT", clearHealthInterval); process.on("SIGINT", clearHealthInterval);
process.on("SIGTERM", clearHealthInterval); process.on("SIGTERM", clearHealthInterval);
process.on("exit", clearHealthInterval); process.on("exit", clearHealthInterval);

View file

@ -13,11 +13,13 @@ function isHealthStatus(value: unknown): value is NetworkConnectionStatus {
return false; return false;
} }
const obj = value as Record<string, unknown>;
return ( return (
typeof obj.isSuccessful === "boolean" && "isSuccessful" in value &&
typeof obj.isWebSocketConnected === "boolean" && typeof value.isSuccessful === "boolean" &&
typeof obj.serverMessage === "string" "isWebSocketConnected" in value &&
typeof value.isWebSocketConnected === "boolean" &&
"serverMessage" in value &&
typeof value.serverMessage === "string"
); );
} }