fix: fix ws server example kill handler usage
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 15 Aug 2023 17:50:09 +0000 (19:50 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 15 Aug 2023 17:50:09 +0000 (19:50 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
examples/typescript/websocket-server-pool/ws-hybrid/src/websocket-server-worker.ts

index 0a1cbdfd956b04265e277b13c5607dad6af5cc37..90250c040ffaac022c6b2b7c0bfea9fd28e1f226 100644 (file)
@@ -94,8 +94,9 @@ ClusterWorkerResponse
 
   public constructor () {
     super(WebSocketServerWorker.startWebSocketServer, {
-      killHandler: () => {
+      killHandler: async () => {
         WebSocketServerWorker.wss.close()
+        await WebSocketServerWorker.requestHandlerPool.destroy()
       }
     })
   }