From: Jérôme Benoit Date: Sun, 24 Dec 2023 19:21:36 +0000 (+0100) Subject: fix: refine pool statuses handling X-Git-Tag: v3.1.12-0~13 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3c9123c7bc41a8815d7371d591ae88e38637bc42;p=poolifier.git fix: refine pool statuses handling Signed-off-by: Jérôme Benoit --- 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 => {