Improve OCPP error handling, fix performance storage default file path
[e-mobility-charging-stations-simulator.git] / src / performance / storage / JSONFileStorage.ts
similarity index 88%
rename from src/utils/performance-storage/JSONFileStorage.ts
rename to src/performance/storage/JSONFileStorage.ts
index 336dc95dda874db20e37ea8b19b60fc42409f8bb..cc7920a0a4aadfe40ffb6710dddf0e012f1ea9ed 100644 (file)
@@ -1,18 +1,17 @@
 // Copyright Jerome Benoit. 2021. All Rights Reserved.
 
-import Constants from '../Constants';
-import FileUtils from '../FileUtils';
+import Constants from '../../utils/Constants';
+import FileUtils from '../../utils/FileUtils';
 import Statistics from '../../types/Statistics';
 import { Storage } from './Storage';
 import fs from 'fs';
-import path from 'path';
 
 export class JSONFileStorage extends Storage {
   private fd: number | null = null;
 
   constructor(storageURI: string, logPrefix: string) {
     super(storageURI, logPrefix);
-    this.dbName = path.join(path.resolve(__dirname, '../../../'), this.storageURI.pathname.replace(/(?:^\/)|(?:\/$)/g, ''));
+    this.dbName = this.storageURI.pathname;
   }
 
   public storePerformanceStatistics(performanceStatistics: Statistics): void {