- https://github.com/cloudfoundry/nodejs-buildpack
no-route: true
health-check-type: process
- health-check-invocation-timeout: 30
+ health-check-invocation-timeout: 10
command: node -r source-map-support/register dist/start.js
env:
# OPTIMIZE_MEMORY: true
logger.info(this.logPrefix(connectorId) + ' transaction ' + this.chargingStation.getConnector(connectorId).transactionId.toString() + ' will stop in ' + Utils.formatDurationMilliSeconds(waitTrxEnd));
await Utils.sleep(waitTrxEnd);
// Stop transaction
- if (this.chargingStation.getConnector(connectorId)?.transactionStarted) {
- logger.info(this.logPrefix(connectorId) + ' stop transaction ' + this.chargingStation.getConnector(connectorId).transactionId.toString());
- await this.stopTransaction(connectorId);
- }
+ logger.info(this.logPrefix(connectorId) + ' stop transaction ' + this.chargingStation.getConnector(connectorId).transactionId.toString());
+ await this.stopTransaction(connectorId);
}
} else {
skippedTransactions++;
delete this.stationInfo.Connectors;
// Initialize transaction attributes on connectors
for (const connector in this.connectors) {
- if (Utils.convertToInt(connector) > 0 && !this.getConnector(Utils.convertToInt(connector)).transactionStarted) {
+ if (Utils.convertToInt(connector) > 0 && !this.getConnector(Utils.convertToInt(connector))?.transactionStarted) {
this.initTransactionAttributesOnConnector(Utils.convertToInt(connector));
}
}
private getNumberOfRunningTransactions(): number {
let trxCount = 0;
for (const connector in this.connectors) {
- if (Utils.convertToInt(connector) > 0 && this.getConnector(Utils.convertToInt(connector)).transactionStarted) {
+ if (Utils.convertToInt(connector) > 0 && this.getConnector(Utils.convertToInt(connector))?.transactionStarted) {
trxCount++;
}
}
this.automaticTransactionGenerator.stop();
} else {
for (const connector in this.connectors) {
- if (Utils.convertToInt(connector) > 0 && this.getConnector(Utils.convertToInt(connector)).transactionStarted) {
+ if (Utils.convertToInt(connector) > 0 && this.getConnector(Utils.convertToInt(connector))?.transactionStarted) {
const transactionId = this.getConnector(Utils.convertToInt(connector)).transactionId;
await this.ocppRequestService.sendStopTransaction(transactionId, this.getEnergyActiveImportRegisterByTransactionId(transactionId),
this.getTransactionIdTag(transactionId), reason);
if (connectorId === 0) {
let response: ChangeAvailabilityResponse = Constants.OCPP_AVAILABILITY_RESPONSE_ACCEPTED;
for (const connector in this.chargingStation.connectors) {
- if (this.chargingStation.getConnector(Utils.convertToInt(connector)).transactionStarted) {
+ if (this.chargingStation.getConnector(Utils.convertToInt(connector))?.transactionStarted) {
response = Constants.OCPP_AVAILABILITY_RESPONSE_SCHEDULED;
}
this.chargingStation.getConnector(Utils.convertToInt(connector)).availability = commandPayload.type;