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
fix: readd safety check in charging station log prefix helper
[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 3fe5e58eed7aef75f35ae120e97033bd3cdb02d5..f44d9f2b35adc56ca0d9d503e927ccfac6eae760 100644
(file)
--- a/
src/performance/storage/JsonFileStorage.ts
+++ b/
src/performance/storage/JsonFileStorage.ts
@@
-47,7
+47,7
@@
export class JsonFileStorage extends Storage {
public open (): void {
JsonFileStorage.performanceRecords = new Map<string, Statistics>()
try {
public open (): void {
JsonFileStorage.performanceRecords = new Map<string, Statistics>()
try {
- if (this
?
.fd == null) {
+ if (this.fd == null) {
if (!existsSync(dirname(this.dbName))) {
mkdirSync(dirname(this.dbName), { recursive: true })
}
if (!existsSync(dirname(this.dbName))) {
mkdirSync(dirname(this.dbName), { recursive: true })
}
@@
-66,9
+66,9
@@
export class JsonFileStorage extends Storage {
public close (): void {
JsonFileStorage.performanceRecords.clear()
try {
public close (): void {
JsonFileStorage.performanceRecords.clear()
try {
- if (this
?
.fd != null) {
+ if (this.fd != null) {
closeSync(this.fd)
closeSync(this.fd)
- delete this
?
.fd
+ delete this.fd
}
} catch (error) {
handleFileException(
}
} catch (error) {
handleFileException(
@@
-81,7
+81,7
@@
export class JsonFileStorage extends Storage {
}
private checkPerformanceRecordsFile (): void {
}
private checkPerformanceRecordsFile (): void {
- if (this
?
.fd == null) {
+ if (this.fd == null) {
throw new BaseError(
`${this.logPrefix} Performance records '${this.dbName}' file descriptor not found`
)
throw new BaseError(
`${this.logPrefix} Performance records '${this.dbName}' file descriptor not found`
)