refactor(simulator): constify and factor out empty data structure
[e-mobility-charging-stations-simulator.git] / src / charging-station / AutomaticTransactionGenerator.ts
index 16fa839d9e99d290214268b3a6c1bc105ed537b2..4185215aae0d25ceccf9618bb289712d46d96ed2 100644 (file)
@@ -1,6 +1,6 @@
 // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
-import { AsyncResource } from 'async_hooks';
+import { AsyncResource } from 'node:async_hooks';
 
 import { type ChargingStation, ChargingStationUtils } from './internal';
 import { BaseError } from '../exception';
@@ -101,9 +101,7 @@ export class AutomaticTransactionGenerator extends AsyncResource {
         ) => Promise<void>,
         this,
         connectorId
-      ).catch(() => {
-        /* This is intentional */
-      });
+      ).catch(Constants.EMPTY_FUNCTION);
     } else if (this.connectorsStatus.get(connectorId)?.start === true) {
       logger.warn(`${this.logPrefix(connectorId)} is already started on connector`);
     }