fix exit handler

This commit is contained in:
srgooglo 2022-05-06 10:32:02 +02:00
parent 604edd49ae
commit daa0110c7e

View File

@ -123,7 +123,6 @@ class Server {
// handle exit events // handle exit events
process.on("SIGTERM", this.cleanupProcess) process.on("SIGTERM", this.cleanupProcess)
process.on("SIGINT", this.cleanupProcess) process.on("SIGINT", this.cleanupProcess)
process.on("exit", this.cleanupProcess)
} }
initializeHeaders = () => { initializeHeaders = () => {
@ -271,10 +270,12 @@ class Server {
} }
cleanupProcess = () => { cleanupProcess = () => {
console.log("🔴 Stopping server...") console.log("🛑 Stopping server...")
this.httpInterface.close() this.httpInterface.close()
this.wsInterface.io.close() this.wsInterface.io.close()
process.exit(1)
} }
// handlers // handlers