build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / performance / storage / JsonFileStorage.ts
index 5effae906dc6965d3d60893c801d5e6b465e8d4d..fb7062674bb2ea14787a2d5eb0ff6646bab75d11 100644 (file)
@@ -16,9 +16,7 @@ export class JsonFileStorage extends Storage {
 
   public storePerformanceStatistics(performanceStatistics: Statistics): void {
     this.checkPerformanceRecordsFile();
-    const asyncLock = AsyncLock.getInstance(AsyncLockType.performance);
-    asyncLock
-      .acquire()
+    AsyncLock.acquire(AsyncLockType.performance)
       .then(() => {
         const fileData = fs.readFileSync(this.dbName, 'utf8');
         const performanceRecords: Statistics[] = fileData
@@ -40,7 +38,7 @@ export class JsonFileStorage extends Storage {
         );
       })
       .finally(() => {
-        asyncLock.release().catch(Constants.EMPTY_FUNCTION);
+        AsyncLock.release(AsyncLockType.performance).catch(Constants.EMPTY_FUNCTION);
       });
   }