From 23b11f60fd283ef169f8d6391efd953141f90b10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 21 Oct 2023 19:46:36 +0200 Subject: [PATCH] refactor: use helper to flag worker node as not ready 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ( -- 2.34.1