private async waitChargingStationsStopped (): Promise<string> {
return await new Promise<string>((resolve, reject) => {
const waitTimeout = setTimeout(() => {
- const message = `Timeout ${formatDurationMilliSeconds(
+ const timeoutMessage = `Timeout ${formatDurationMilliSeconds(
Constants.STOP_CHARGING_STATIONS_TIMEOUT
)} reached at stopping charging stations`
- console.warn(chalk.yellow(message))
- reject(new Error(message))
+ console.warn(chalk.yellow(timeoutMessage))
+ reject(new Error(timeoutMessage))
}, Constants.STOP_CHARGING_STATIONS_TIMEOUT)
waitChargingStationEvents(
this,
ChargingStationWorkerMessageEvents.stopped,
- this.numberOfChargingStations
+ this.numberOfStartedChargingStations
)
.then(() => {
resolve('Charging stations stopped')