this.starting = false;
}
- public async stop(): Promise<void> {
+ public stop(): void {
if (this.started === false) {
logger.warn(`${this.logPrefix()} is already stopped`);
return;
return;
}
this.stopping = true;
- await this.stopConnectors();
+ this.stopConnectors();
this.started = false;
this.stopping = false;
}
}
}
- public async stopConnector(connectorId: number): Promise<void> {
+ public stopConnector(connectorId: number): void {
if (this.connectorsStatus.has(connectorId) === false) {
logger.error(`${this.logPrefix(connectorId)} stopping on non existing connector`);
throw new BaseError(`Connector ${connectorId} does not exist`);
}
if (this.connectorsStatus.get(connectorId)?.start === true) {
this.connectorsStatus.get(connectorId)!.start = false;
- await this.stopTransaction(connectorId);
} else if (this.connectorsStatus.get(connectorId)?.start === false) {
logger.warn(`${this.logPrefix(connectorId)} is already stopped on connector`);
}
}
}
- private async stopConnectors(): Promise<void> {
+ private stopConnectors(): void {
if (this.chargingStation.hasEvses) {
for (const [evseId, evseStatus] of this.chargingStation.evses) {
if (evseId > 0) {
for (const connectorId of evseStatus.connectors.keys()) {
- await this.stopConnector(connectorId);
+ this.stopConnector(connectorId);
}
}
}
} else {
for (const connectorId of this.chargingStation.connectors.keys()) {
if (connectorId > 0) {
- await this.stopConnector(connectorId);
+ this.stopConnector(connectorId);
}
}
}
);
while (this.connectorsStatus.get(connectorId)?.start === true) {
if (!this.canStartConnector(connectorId)) {
- await this.stopConnector(connectorId);
+ this.stopConnector(connectorId);
break;
}
if (!this.chargingStation?.ocppRequestService) {
private async stopTransaction(
connectorId: number,
- reason: StopTransactionReason = StopTransactionReason.LOCAL,
+ reason = StopTransactionReason.LOCAL,
): Promise<StopTransactionResponse | undefined> {
const measureId = 'StopTransaction with ATG';
const beginId = PerformanceStatistics.beginMeasure(measureId);