From: Jérôme Benoit Date: Sat, 21 Oct 2023 17:46:36 +0000 (+0200) Subject: refactor: use helper to flag worker node as not ready X-Git-Tag: v3.0.5~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=23b11f60fd283ef169f8d6391efd953141f90b10;p=poolifier.git refactor: use helper to flag worker node as not ready Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index ef5ebead..2545d6a9 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1219,8 +1219,8 @@ export abstract class AbstractPool< worker.on('error', this.opts.errorHandler ?? EMPTY_FUNCTION) worker.on('error', error => { const workerNodeKey = this.getWorkerNodeKeyByWorker(worker) + this.flagWorkerNodeAsNotReady(workerNodeKey) const workerInfo = this.getWorkerInfo(workerNodeKey) - workerInfo.ready = false this.emitter?.emit(PoolEvents.error, error) this.workerNodes[workerNodeKey].closeChannel() if (