From 111aaf897c1c7b5c2f48678923a458f62406e3e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 24 May 2023 20:50:03 +0200 Subject: [PATCH] refactor(simulator): warn at startup for missing id tags file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationUtils.ts | 8 ++++++++ src/charging-station/IdTagsCache.ts | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ChargingStationUtils.ts b/src/charging-station/ChargingStationUtils.ts index e76b3a6e..6fde11e2 100644 --- a/src/charging-station/ChargingStationUtils.ts +++ b/src/charging-station/ChargingStationUtils.ts @@ -175,6 +175,14 @@ export class ChargingStationUtils { `${logPrefix} Empty automatic transaction generator configuration from template file ${templateFile}, set to default values` ); } + if ( + Utils.isNullOrUndefined(stationTemplate.idTagsFile) || + Utils.isEmptyString(stationTemplate.idTagsFile) + ) { + logger.warn( + `${logPrefix} Missing id tags file in template file ${templateFile}. That can lead to issues with the Automatic Transaction Generator` + ); + } } public static checkConnectorsConfiguration( diff --git a/src/charging-station/IdTagsCache.ts b/src/charging-station/IdTagsCache.ts index e5ee13c3..ff5c49d9 100644 --- a/src/charging-station/IdTagsCache.ts +++ b/src/charging-station/IdTagsCache.ts @@ -180,7 +180,6 @@ export class IdTagsCache { ); } } - logger.info(`${this.logPrefix(file)} No id tags file given in configuration`); return []; } -- 2.34.1