Make sigterm exit after 3 seconds to resolve hang under systemd

This commit is contained in:
TheArcaneBrony
2022-08-10 04:59:32 +02:00
parent 92b4c5ca35
commit eb07664e93
+1
View File
@@ -26,6 +26,7 @@ const gateway = new Gateway.Server({ server, port, production });
//this is what has been added for the /stop API route
process.on('SIGTERM', () => {
setTimeout(()=>process.exit(0), 3000)
server.close(() => {
console.log("Stop API has been successfully POSTed, SIGTERM sent")
})