1 const Configuration
= require('./utils/Configuration');
2 const Utils
= require('./utils/Utils');
3 const Wrk
= require('./charging-station/Worker');
4 const logger
= require('./utils/Logger');
9 logger
.info('%s Configuration: %j', Utils
.basicFormatLog(), Configuration
.getConfig());
10 // Start each ChargingStation object in a worker thread
11 if (Configuration
.getStationTemplateURLs()) {
12 let numStationsTotal
= 0;
13 Configuration
.getStationTemplateURLs().forEach((stationURL
) => {
15 const nbStation
= stationURL
.numberOfStation
? stationURL
.numberOfStation
: 0;
16 numStationsTotal
+= nbStation
;
17 for (let index
= 1; index
<= nbStation
; index
++) {
18 const worker
= new Wrk('./src/charging-station/StationWorker.js', {
20 templateFile
: stationURL
.file
,
25 // eslint-disable-next-line no-console
26 console
.log('Charging station start with template file ' + stationURL
.file
+ ' error ' + JSON
.stringify(error
, null, ' '));
30 console
.log('No stationTemplateURLs defined in configuration, exiting');
33 // eslint-disable-next-line no-console
34 console
.log('Bootstrap start error ' + JSON
.stringify(error
, null, ' '));