From: Jérôme Benoit Date: Wed, 21 Jun 2023 23:28:38 +0000 (+0200) Subject: fix: ensure worker graceful shutdown is tried in cluster pool X-Git-Tag: v2.6.4~42 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5b59d53ed7dd50ad5d42c0d5c146813e2c38132a;p=poolifier.git fix: ensure worker graceful shutdown is tried in cluster pool Signed-off-by: Jérôme Benoit --- 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 */