fix bare server not being closed

this will just hang if it isn't closed...
This commit is contained in:
David Reed 2023-06-04 17:20:07 -04:00
parent e78d8b3070
commit f55b5f7635
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F

View file

@ -59,15 +59,13 @@ server.on("listening", () => {
});
// https://expressjs.com/en/advanced/healthcheck-graceful-shutdown.html
process.on("SIGINT", shutdown)
process.on("SIGTERM", shutdown)
process.on("SIGINT", shutdown);
process.on("SIGTERM", shutdown);
function shutdown() {
console.log('SIGTERM signal received: closing HTTP server')
server.close(() => {
console.log('Server closed.');
process.exit(0);
});
console.log("SIGTERM signal received: closing HTTP server");
server.close();
bare.close();
}
server.listen({