Improve settings #168
2 changed files with 9 additions and 5 deletions
Lint
commit
7bb7765c84
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue