!mikro-orm.config-template.ts
manifest.yml
+### Git ###
+# Created by git for backups. To disable backups in Git:
+# $ git config --global mergetool.keepBackup false
+*.orig
+
+# Created by git when using merge tools for conflicts
+*.BACKUP.*
+*.BASE.*
+*.LOCAL.*
+*.REMOTE.*
+*_BACKUP_*.txt
+*_BASE_*.txt
+*_LOCAL_*.txt
+*_REMOTE_*.txt
+
# Logs
logs
*.log
"type": "git",
"url": "https://github.com/sap/e-mobility-charging-stations-simulator.git"
},
- "description": "Electric Vehicle charging stations simulator",
+ "description": "Electric vehicle charging stations simulator",
"author": "SAP E-Mobility <e-mobility@sap.com>",
"contributors": [
{
}
if (this.connectorsStatus.get(connectorId)?.start === false) {
this.runInAsyncScope(
- this.internalStartConnector.bind(this) as (this: this, ...args: any[]) => unknown,
+ this.internalStartConnector.bind(this) as (
+ this: AutomaticTransactionGenerator,
+ ...args: any[]
+ ) => void,
this,
connectorId
);
this.uiServer?.chargingStations.set(data.stationInfo.hashId, data);
++this.numberOfStartedChargingStations;
logger.info(
- `${this.logPrefix()} ${moduleName}.workerEventStarted: Charging station '${
+ `${this.logPrefix()} ${moduleName}.workerEventStarted: Charging station ${
data.stationInfo.chargingStationId
- } (hashId: ${data.stationInfo.hashId})' started (${
+ } (hashId: ${data.stationInfo.hashId}) started (${
this.numberOfStartedChargingStations
} started from ${this.numberOfChargingStations})`
);
this.uiServer?.chargingStations.set(data.stationInfo.hashId, data);
--this.numberOfStartedChargingStations;
logger.info(
- `${this.logPrefix()} ${moduleName}.workerEventStopped: Charging station '${
+ `${this.logPrefix()} ${moduleName}.workerEventStopped: Charging station ${
data.stationInfo.chargingStationId
- } (hashId: ${data.stationInfo.hashId})' stopped (${
+ } (hashId: ${data.stationInfo.hashId}) stopped (${
this.numberOfStartedChargingStations
} started from ${this.numberOfChargingStations})`
);
chargingStation: ChargingStation,
commandPayload: ResetRequest
): DefaultResponse {
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- setImmediate(async (): Promise<void> => {
- await chargingStation.reset((commandPayload.type + 'Reset') as OCPP16StopTransactionReason);
- });
+ this.asyncResource.runInAsyncScope(
+ chargingStation.reset.bind(chargingStation) as (
+ this: ChargingStation,
+ ...args: any[]
+ ) => void,
+ chargingStation,
+ (commandPayload.type + 'Reset') as OCPP16StopTransactionReason
+ );
logger.info(
`${chargingStation.logPrefix()} ${
commandPayload.type
+import { AsyncResource } from 'async_hooks';
+
import type { JSONSchemaType } from 'ajv';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
export default abstract class OCPPIncomingRequestService {
private static instance: OCPPIncomingRequestService | null = null;
+ protected asyncResource: AsyncResource;
private ajv: Ajv;
protected constructor() {
+ this.asyncResource = new AsyncResource(moduleName);
this.ajv = new Ajv();
ajvFormats(this.ajv);
this.incomingRequestHandler.bind(this);
node_modules
/dist
+### Git ###
+# Created by git for backups. To disable backups in Git:
+# $ git config --global mergetool.keepBackup false
+*.orig
+
+# Created by git when using merge tools for conflicts
+*.BACKUP.*
+*.BASE.*
+*.LOCAL.*
+*.REMOTE.*
+*_BACKUP_*.txt
+*_BASE_*.txt
+*_LOCAL_*.txt
+*_REMOTE_*.txt
# local env files
.env.local