- this.numberOfChargingStationTemplates = 0;
- this.numberOfChargingStations = 0;
- const stationTemplateUrls = Configuration.getStationTemplateUrls();
- if (!Utils.isEmptyArray(stationTemplateUrls)) {
- this.numberOfChargingStationTemplates = stationTemplateUrls?.length;
- stationTemplateUrls.forEach((stationTemplateUrl) => {
- this.numberOfChargingStations += stationTemplateUrl.numberOfStations ?? 0;
- });
- } else {
- console.warn(
- chalk.yellow("'stationTemplateUrls' not defined or empty in configuration, exiting")
- );
- process.exit(exitCodes.missingChargingStationsConfiguration);
- }
- if (this.numberOfChargingStations === 0) {
- console.warn(chalk.yellow('No charging station template enabled in configuration, exiting'));
- process.exit(exitCodes.noChargingStationTemplates);
+ if (this.initializedCounters === false) {
+ this.numberOfChargingStationTemplates = 0;
+ this.numberOfChargingStations = 0;
+ const stationTemplateUrls = Configuration.getStationTemplateUrls();
+ if (Utils.isNotEmptyArray(stationTemplateUrls)) {
+ this.numberOfChargingStationTemplates = stationTemplateUrls.length;
+ for (const stationTemplateUrl of stationTemplateUrls) {
+ this.numberOfChargingStations += stationTemplateUrl.numberOfStations ?? 0;
+ }
+ } else {
+ console.warn(
+ chalk.yellow("'stationTemplateUrls' not defined or empty in configuration, exiting")
+ );
+ process.exit(exitCodes.missingChargingStationsConfiguration);
+ }
+ if (this.numberOfChargingStations === 0) {
+ console.warn(
+ chalk.yellow('No charging station template enabled in configuration, exiting')
+ );
+ process.exit(exitCodes.noChargingStationTemplates);
+ }
+ this.numberOfStartedChargingStations = 0;
+ this.initializedCounters = true;