Add onClose back in tests
This commit is contained in:
parent
c78038f059
commit
9703564283
|
@ -63,22 +63,22 @@ 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) {
|
return
|
||||||
return
|
}
|
||||||
}
|
shuttingDown = true
|
||||||
shuttingDown = true
|
console.log("Server Closed")
|
||||||
console.log("Server Closed")
|
await automations.shutdown()
|
||||||
await automations.shutdown()
|
await redis.shutdown()
|
||||||
await redis.shutdown()
|
events.shutdown()
|
||||||
await 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)
|
||||||
|
|
Loading…
Reference in New Issue