fix: ensure the ATG will start from its saved status
[e-mobility-charging-stations-simulator.git] / src / charging-station / Helpers.ts
index 90ecd0e8154814c6a2be8f70c6b508690f59c096..99a8f82cb5dca431de4f3c6f49ca044129f16c7e 100644 (file)
@@ -1,6 +1,7 @@
 import { createHash, randomBytes } from 'node:crypto';
 import type { EventEmitter } from 'node:events';
 import { basename, dirname, join } from 'node:path';
+import { env } from 'node:process';
 import { fileURLToPath } from 'node:url';
 
 import chalk from 'chalk';
@@ -76,7 +77,7 @@ export const getChargingStationId = (
   stationTemplate: ChargingStationTemplate,
 ): string => {
   // In case of multiple instances: add instance index to charging station id
-  const instanceIndex = process.env.CF_INSTANCE_INDEX ?? 0;
+  const instanceIndex = env.CF_INSTANCE_INDEX ?? 0;
   const idSuffix = stationTemplate?.nameSuffix ?? '';
   const idStr = `000000000${index.toString()}`;
   return stationTemplate?.fixedName