refactor: remove unneeded redefinition of poolifier defaults
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 9 Sep 2023 19:58:33 +0000 (21:58 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 9 Sep 2023 19:58:33 +0000 (21:58 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStationWorker.ts
src/worker/WorkerConstants.ts
src/worker/index.ts

index 7c7a523558bd6e9b547afe8775ec71c79f11187b..003d9fea96fd718f42fa356683ab0b10f231c7fb 100644 (file)
@@ -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<ChargingStationWorkerData>;
 if (Configuration.workerPoolInUse()) {
-  chargingStationWorker = new ThreadWorker<ChargingStationWorkerData>(startChargingStation, {
-    maxInactiveTime: POOL_MAX_INACTIVE_TIME,
-  });
+  chargingStationWorker = new ThreadWorker<ChargingStationWorkerData>(startChargingStation);
 } else {
   chargingStationWorker = new ChargingStationWorker();
 }
index bbfcdac4b10a37b55adf26ee21d5385517b97ca9..8c66df029213ca4876f213ca2dcb552a27317bbb 100644 (file)
@@ -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;
index e53c3457fa636e3496ce8ab823b19f41d5965f7c..a7c3d1ea1f185b0e5c77b78b3de7c41994273638 100644 (file)
@@ -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 {