From: Jérôme Benoit Date: Sat, 12 Mar 2022 20:00:22 +0000 (+0100) Subject: Code cleanups X-Git-Tag: v1.1.55~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=25f5a959c137b7d302485e8ef6ca9d4a2f1cb6f6;p=e-mobility-charging-stations-simulator.git Code cleanups Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 01829fdf..e8122d18 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -102,7 +102,7 @@ export default class ChargingStation { this.authorizedTags = this.getAuthorizedTags(); } - get wsConnectionUrl(): URL { + private get wsConnectionUrl(): URL { return this.getSupervisionUrlOcppConfiguration() ? new URL( this.getConfigurationKey(this.getSupervisionUrlOcppKey()).value + @@ -536,15 +536,6 @@ export default class ChargingStation { } } ); - // FIXME: triggered by saveConfiguration() - // if (this.getOcppPersistentConfiguration()) { - // FileUtils.watchJsonFile( - // this.logPrefix(), - // FileType.ChargingStationConfiguration, - // this.configurationFile, - // this.configuration - // ); - // } // Handle WebSocket message this.wsConnection.on( 'message', diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 6da954d1..b39665e5 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -42,7 +42,7 @@ export default class Configuration { // Read conf return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'logStatisticsInterval') ? Configuration.getConfig().logStatisticsInterval - : 60; + : Constants.DEFAULT_LOG_STATISTICS_INTERVAL; } static getUIWebSocketServer(): UIWebSocketServerConfiguration { diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 76697c8a..b115a42f 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -95,6 +95,8 @@ export default class Constants { static readonly DEFAULT_CONNECTION_TIMEOUT = 30; + static readonly DEFAULT_LOG_STATISTICS_INTERVAL = 60; // Seconds + static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000; // Ms static readonly SUPPORTED_MEASURANDS = Object.freeze([