From: Jérôme Benoit Date: Thu, 2 Jun 2022 22:41:53 +0000 (+0200) Subject: Ensure that workerSet always properly start a worker at init X-Git-Tag: v1.1.61~13 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c1cee6029e88a827b830dca95ad2125d05a7a13c;p=e-mobility-charging-stations-simulator.git Ensure that workerSet always properly start a worker at init Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index 6e890902..73014977 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -46,6 +46,7 @@ export default class WorkerSet extends WorkerAbstract { throw new Error("Cannot add a WorkerSet element: workers' set does not exist"); } if ( + this.workerSet.size === 0 || this.getLastWorkerSetElement().numberOfWorkerElements >= this.workerOptions.elementsPerWorker ) { await this.startWorker();