mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-25 05:55:34 +00:00
Make sigterm exit after 3 seconds to resolve hang under systemd
This commit is contained in:
@@ -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")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user