From 3c9123c7bc41a8815d7371d591ae88e38637bc42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 24 Dec 2023 20:21:36 +0100 Subject: [PATCH] fix: refine pool statuses handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index c8d45511..b72d8cbc 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1224,7 +1224,6 @@ export abstract class AbstractPool< this.emitter?.emit(PoolEvents.error, error) if ( this.started && - !this.starting && !this.destroying && this.opts.restartWorkerOnError === true ) { @@ -1234,7 +1233,11 @@ export abstract class AbstractPool< this.createAndSetupWorkerNode() } } - if (this.started && this.opts.enableTasksQueue === true) { + if ( + this.started && + !this.destroying && + this.opts.enableTasksQueue === true + ) { this.redistributeQueuedTasks(this.workerNodes.indexOf(workerNode)) } workerNode?.terminate().catch(error => { -- 2.34.1