| UIServerConfiguration;
export class Configuration {
+ public static configurationChangeCallback: () => Promise<void>;
+
private static configurationFile = join(
dirname(fileURLToPath(import.meta.url)),
'assets',
[ConfigurationSection.uiServer, Configuration.buildUIServerSection()],
]);
- private static configurationChangeCallback?: () => Promise<void>;
-
private constructor() {
// This is intentional
}
- public static setConfigurationChangeCallback(cb: () => Promise<void>): void {
- Configuration.configurationChangeCallback = cb;
- }
-
public static getConfigurationSection<T extends ConfigurationSectionType>(
sectionName: ConfigurationSection,
): T {
}
public static workerPoolInUse(): boolean {
- return [WorkerProcessType.dynamicPool, WorkerProcessType.staticPool].includes(
+ return [WorkerProcessType.dynamicPool, WorkerProcessType.fixedPool].includes(
Configuration.getConfigurationSection<WorkerConfiguration>(ConfigurationSection.worker)
.processType!,
);
`Use '${ConfigurationSection.worker}' section to define the worker pool minimum size instead`,
);
Configuration.warnDeprecatedConfigurationKey(
- 'workerPoolSize;',
+ 'workerPoolSize',
undefined,
`Use '${ConfigurationSection.worker}' section to define the worker pool maximum size instead`,
);
Configuration.warnDeprecatedConfigurationKey(
- 'workerPoolMaxSize;',
+ 'workerPoolMaxSize',
undefined,
`Use '${ConfigurationSection.worker}' section to define the worker pool maximum size instead`,
);
Configuration.warnDeprecatedConfigurationKey(
- 'workerPoolStrategy;',
+ 'workerPoolStrategy',
undefined,
`Use '${ConfigurationSection.worker}' section to define the worker pool strategy instead`,
);
ConfigurationSection.worker,
'Not publicly exposed to end users',
);
+ if (
+ Configuration.getConfigurationData()?.worker?.processType ===
+ ('staticPool' as WorkerProcessType)
+ ) {
+ console.error(
+ `${chalk.green(Configuration.logPrefix())} ${chalk.red(
+ `Deprecated configuration 'staticPool' value usage in worker section 'processType' field. Use '${WorkerProcessType.fixedPool}' value instead`,
+ )}`,
+ );
+ }
// log section
Configuration.warnDeprecatedConfigurationKey(
'logEnabled',
delete Configuration.configurationData;
Configuration.configurationSectionCache.clear();
if (!isUndefined(Configuration.configurationChangeCallback)) {
- Configuration.configurationChangeCallback!().catch((error) => {
+ Configuration.configurationChangeCallback().catch((error) => {
throw typeof error === 'string' ? new Error(error) : error;
});
}
let logMsg: string;
switch (error.code) {
case 'ENOENT':
- logMsg = `${fileType} file ${file} not found:`;
+ logMsg = `${fileType} file ${file} not found: `;
break;
case 'EEXIST':
- logMsg = `${fileType} file ${file} already exists:`;
+ logMsg = `${fileType} file ${file} already exists: `;
break;
case 'EACCES':
- logMsg = `${fileType} file ${file} access denied:`;
+ logMsg = `${fileType} file ${file} access denied: `;
break;
case 'EPERM':
- logMsg = `${fileType} file ${file} permission denied:`;
+ logMsg = `${fileType} file ${file} permission denied: `;
break;
default:
- logMsg = `${fileType} file ${file} error:`;
+ logMsg = `${fileType} file ${file} error: `;
}
- console.error(`${chalk.green(prefix)}${chalk.red(`${logMsg} `)}`, error);
+ console.error(`${chalk.green(prefix)}${chalk.red(logMsg)}`, error);
throw error;
}