chore: improve wss adapter cleanup

This commit is contained in:
Ricardo Arturo Cabral Mejia 2022-09-20 05:10:03 +00:00
parent 525630a49c
commit 6cf2b8cddf
No known key found for this signature in database
GPG Key ID: 5931EBF43A650245

View File

@ -73,13 +73,13 @@ export class WebSocketServerAdapter extends WebServerAdapter implements IWebSock
)
}
protected onClose() {
this.webSocketServer.clients.forEach((webSocket: WebSocket) =>
webSocket.terminate()
)
console.debug(`worker ${process.pid} - websocket server closing`)
clearInterval(this.heartbeatInterval)
this.removeAllListeners()
this.webSocketServer.removeAllListeners()
super.onClose()
}