From 5b59d53ed7dd50ad5d42c0d5c146813e2c38132a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 22 Jun 2023 01:28:38 +0200 Subject: [PATCH] fix: ensure worker graceful shutdown is tried in cluster pool MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/cluster/fixed.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index a13a95ce..3f56c858 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -69,7 +69,10 @@ export class FixedClusterPool< /** @inheritDoc */ protected destroyWorker (worker: Worker): void { this.sendToWorker(worker, { kill: 1 }) - worker.kill() + worker.on('disconnect', () => { + worker.kill() + }) + worker.disconnect() } /** @inheritDoc */ -- 2.34.1