From: Jérôme Benoit Date: Thu, 4 Apr 2024 09:13:37 +0000 (+0200) Subject: fix: register worker error callback once X-Git-Tag: v1.3.2~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4119f48015ac2320226a96e34a0658f0cea09440;p=e-mobility-charging-stations-simulator.git fix: register worker error callback once Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index b09ea711..c45e6a61 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -182,7 +182,7 @@ export class WorkerSet extends Worke } }) worker.on('error', this.workerOptions.poolOptions?.errorHandler ?? EMPTY_FUNCTION) - worker.on('error', error => { + worker.once('error', error => { this.emitter?.emit(WorkerSetEvents.error, error) if ( this.workerOptions.poolOptions?.restartWorkerOnError === true &&