repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: rename a template key to a more sensible name
[e-mobility-charging-stations-simulator.git]
/
src
/
performance
/
storage
/
JsonFileStorage.ts
diff --git
a/src/performance/storage/JsonFileStorage.ts
b/src/performance/storage/JsonFileStorage.ts
index 3128c862211f4df4866a1426aa53f7208c4219a2..fcb35a4df0507569d941edbcb1aac223561e6be4 100644
(file)
--- a/
src/performance/storage/JsonFileStorage.ts
+++ b/
src/performance/storage/JsonFileStorage.ts
@@
-4,10
+4,9
@@
import fs from 'node:fs';
import lockfile from 'proper-lockfile';
import lockfile from 'proper-lockfile';
-import { Storage } from './Storage';
import { FileType, type Statistics } from '../../types';
import { FileType, type Statistics } from '../../types';
-import {
FileUtils } from '../../utils/FileU
tils';
-import {
Utils } from '../../utils/Utils
';
+import {
Constants, FileUtils, Utils } from '../../u
tils';
+import {
Storage } from '../internal
';
export class JsonFileStorage extends Storage {
private fd: number | null = null;
export class JsonFileStorage extends Storage {
private fd: number | null = null;
@@
-43,14
+42,12
@@
export class JsonFileStorage extends Storage {
}
await release();
})
}
await release();
})
- .catch(() => {
- /* This is intentional */
- });
+ .catch(Constants.EMPTY_FUNCTION);
}
public open(): void {
try {
}
public open(): void {
try {
- if (
this?.fd === undefined || this?.fd === null
) {
+ if (
Utils.isNullOrUndefined(this?.fd)
) {
this.fd = fs.openSync(this.dbName, 'a+');
}
} catch (error) {
this.fd = fs.openSync(this.dbName, 'a+');
}
} catch (error) {