From bcbb76a6957d1c0bad4a51c040af58788b8b186f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 9 Sep 2023 21:58:33 +0200 Subject: [PATCH] refactor: remove unneeded redefinition of poolifier defaults MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationWorker.ts | 6 ++---- src/worker/WorkerConstants.ts | 1 - src/worker/index.ts | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 7c7a5235..003d9fea 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -9,7 +9,7 @@ import { ChargingStation } from './ChargingStation'; import { BaseError } from '../exception'; import type { ChargingStationWorkerData } from '../types'; import { Configuration } from '../utils'; -import { POOL_MAX_INACTIVE_TIME, type WorkerMessage, WorkerMessageEvents } from '../worker'; +import { type WorkerMessage, WorkerMessageEvents } from '../worker'; const moduleName = 'ChargingStationWorker'; @@ -63,9 +63,7 @@ class ChargingStationWorker extends AsyncResource { export let chargingStationWorker: ChargingStationWorker | ThreadWorker; if (Configuration.workerPoolInUse()) { - chargingStationWorker = new ThreadWorker(startChargingStation, { - maxInactiveTime: POOL_MAX_INACTIVE_TIME, - }); + chargingStationWorker = new ThreadWorker(startChargingStation); } else { chargingStationWorker = new ChargingStationWorker(); } diff --git a/src/worker/WorkerConstants.ts b/src/worker/WorkerConstants.ts index bbfcdac4..8c66df02 100644 --- a/src/worker/WorkerConstants.ts +++ b/src/worker/WorkerConstants.ts @@ -10,7 +10,6 @@ export const workerSetVersion = '1.0.1'; export const DEFAULT_ELEMENT_START_DELAY = 0; export const DEFAULT_WORKER_START_DELAY = 500; -export const POOL_MAX_INACTIVE_TIME = 60000; export const DEFAULT_POOL_MIN_SIZE = Math.floor(availableParallelism() / 2); export const DEFAULT_POOL_MAX_SIZE = Math.round(availableParallelism() * 1.5); export const DEFAULT_ELEMENTS_PER_WORKER = 1; diff --git a/src/worker/index.ts b/src/worker/index.ts index e53c3457..a7c3d1ea 100644 --- a/src/worker/index.ts +++ b/src/worker/index.ts @@ -4,7 +4,6 @@ export { DEFAULT_POOL_MAX_SIZE, DEFAULT_POOL_MIN_SIZE, DEFAULT_WORKER_START_DELAY, - POOL_MAX_INACTIVE_TIME, } from './WorkerConstants'; export { WorkerFactory } from './WorkerFactory'; export { -- 2.34.1