From c1cee6029e88a827b830dca95ad2125d05a7a13c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 3 Jun 2022 00:41:53 +0200 Subject: [PATCH] Ensure that workerSet always properly start a worker at init MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/WorkerSet.ts | 1 + 1 file changed, 1 insertion(+) 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(); -- 2.34.1