From c96c65446db22c81ae48714691dbf974a8141b1d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 23 Jan 2021 07:55:53 +0100 Subject: [PATCH] Make some Wrk attributes conditionally initialized. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Worker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/charging-station/Worker.ts b/src/charging-station/Worker.ts index 824a304b..8a9e9f91 100644 --- a/src/charging-station/Worker.ts +++ b/src/charging-station/Worker.ts @@ -5,7 +5,6 @@ import WorkerData from '../types/WorkerData'; import WorkerPool from './WorkerPool'; export default class Wrk { - private static wrkInstances: Wrk[]; private workerScript: string; private workerData: WorkerData; private worker: Worker; @@ -22,10 +21,11 @@ export default class Wrk { constructor(workerScript: string, workerData: WorkerData, maxWorkerElements = 1) { this.workerData = workerData; this.workerScript = workerScript; - this.maxWorkerElements = maxWorkerElements; - this.numWorkerElements = 0; if (Configuration.useWorkerPool()) { WorkerPool.maxConcurrentWorkers = Configuration.getWorkerPoolMaxSize(); + } else { + this.maxWorkerElements = maxWorkerElements; + this.numWorkerElements = 0; } } -- 2.34.1