Add onClose back in tests

This commit is contained in:
Adria Navarro 2023-02-04 20:30:12 +00:00
parent e0affd656b
commit b2bdd00a6b
1 changed files with 15 additions and 15 deletions

View File

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