X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FConfiguration.ts;h=f1f43bcfff188f353c10534199895533a34b25fe;hb=44eb6026079c8dc2c77b10a96a42d0c0b2da7c8f;hp=fb77ff2ea810653294e6558d1539dd251e49fbba;hpb=91ecff2da29c7d1930ab1e8d90d159ae7a8c722e;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index fb77ff2e..f1f43bcf 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -6,6 +6,7 @@ import chalk from 'chalk'; import merge from 'just-merge'; import { WorkerChoiceStrategies } from 'poolifier'; +import Constants from './Constants'; import { type ConfigurationData, type StationTemplateUrl, @@ -21,7 +22,6 @@ import { StorageType } from '../types/Storage'; import { ApplicationProtocol } from '../types/UIProtocol'; import { WorkerProcessType } from '../types/Worker'; import WorkerConstants from '../worker/WorkerConstants'; -import Constants from './Constants'; export default class Configuration { private static configurationFile = path.join( @@ -328,13 +328,13 @@ export default class Configuration { ) { console.error( chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${ - logMsgToAppend && '. ' + logMsgToAppend + logMsgToAppend && `. ${logMsgToAppend}` }}` ); } else if (!Configuration.isUndefined(Configuration.getConfig()[key])) { console.error( chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage${ - logMsgToAppend && '. ' + logMsgToAppend + logMsgToAppend && `. ${logMsgToAppend}` }}` ); } @@ -390,7 +390,6 @@ export default class Configuration { } private static getDefaultPerformanceStorageUri(storageType: StorageType) { - const SQLiteFileName = `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`; switch (storageType) { case StorageType.JSON_FILE: return `file://${path.join( @@ -400,7 +399,7 @@ export default class Configuration { case StorageType.SQLITE: return `file://${path.join( path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../'), - SQLiteFileName + `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db` )}`; default: throw new Error(`Performance storage URI is mandatory with storage type '${storageType}'`);