From 65a1157a0c0f0a7b23b7a6fc23432f2c3e7cb735 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 29 Nov 2023 21:28:06 +0100 Subject: [PATCH] refactor: cleanup ElementsPerWorkerType type definition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/types/ConfigurationData.ts | 4 ++-- src/types/index.ts | 1 + src/utils/ConfigurationUtils.ts | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/types/ConfigurationData.ts b/src/types/ConfigurationData.ts index df362b53..d1948921 100644 --- a/src/types/ConfigurationData.ts +++ b/src/types/ConfigurationData.ts @@ -64,12 +64,12 @@ export interface StorageConfiguration { uri?: string; } -export type elementsPerWorkerType = number | 'auto' | 'all'; +export type ElementsPerWorkerType = number | 'auto' | 'all'; export interface WorkerConfiguration { processType?: WorkerProcessType; startDelay?: number; - elementsPerWorker?: elementsPerWorkerType; + elementsPerWorker?: ElementsPerWorkerType; elementStartDelay?: number; poolMinSize?: number; poolMaxSize?: number; diff --git a/src/types/index.ts b/src/types/index.ts index a28d5114..a707b46b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -167,6 +167,7 @@ export { ApplicationProtocolVersion, type ConfigurationData, ConfigurationSection, + type ElementsPerWorkerType, type LogConfiguration, type StationTemplateUrl, type StorageConfiguration, diff --git a/src/utils/ConfigurationUtils.ts b/src/utils/ConfigurationUtils.ts index 660bc764..73bd9ceb 100644 --- a/src/utils/ConfigurationUtils.ts +++ b/src/utils/ConfigurationUtils.ts @@ -5,8 +5,7 @@ import chalk from 'chalk'; import { Constants } from './Constants'; import { isNotEmptyString, logPrefix as utilsLogPrefix } from './Utils'; -import { FileType, StorageType } from '../types'; -import type { elementsPerWorkerType } from '../types/ConfigurationData'; +import { type ElementsPerWorkerType, FileType, StorageType } from '../types'; import { WorkerProcessType } from '../worker'; export const logPrefix = (): string => { @@ -69,7 +68,7 @@ export const checkWorkerProcessType = (workerProcessType: WorkerProcessType): vo }; export const checkWorkerElementsPerWorker = ( - elementsPerWorker: elementsPerWorkerType | undefined, + elementsPerWorker: ElementsPerWorkerType | undefined, ): void => { if ( elementsPerWorker !== undefined && -- 2.34.1