From: Jérôme Benoit Date: Mon, 1 Apr 2024 17:08:00 +0000 (+0200) Subject: refactor: register once internal worker error event listener X-Git-Tag: v3.1.29~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b271fce0078f073d95b4ff2ceae50042b36ce50d;p=poolifier.git refactor: register once internal worker error event listener Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 9610f341..0cec96ab 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1241,7 +1241,7 @@ export abstract class AbstractPool< 'error', this.opts.errorHandler ?? EMPTY_FUNCTION ) - workerNode.registerWorkerEventHandler('error', (error: Error) => { + workerNode.registerOnceWorkerEventHandler('error', (error: Error) => { workerNode.info.ready = false this.emitter?.emit(PoolEvents.error, error) if (