1
0
Fork 0
mirror of synced 2024-08-14 17:42:01 +12:00

Add onClose back in tests

This commit is contained in:
Adria Navarro 2023-02-04 20:30:12 +00:00
parent c78038f059
commit 9703564283

View file

@ -63,22 +63,22 @@ initialiseWebsockets(server)
let shuttingDown = false,
errCode = 0
if (!env.isTest()) {
server.on("close", async () => {
// already in process
if (shuttingDown) {
return
}
shuttingDown = true
console.log("Server Closed")
await automations.shutdown()
await redis.shutdown()
await events.shutdown()
await Thread.shutdown()
api.shutdown()
server.on("close", async () => {
// already in process
if (shuttingDown) {
return
}
shuttingDown = true
console.log("Server Closed")
await automations.shutdown()
await redis.shutdown()
events.shutdown()
await Thread.shutdown()
api.shutdown()
if (!env.isTest()) {
process.exit(errCode)
})
}
}
})
export default server.listen(env.PORT || 0, async () => {
await startup(app, server)