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 })
}
public close (): void {
JsonFileStorage.performanceRecords.clear()
try {
- if (this?.fd != null) {
+ if (this.fd != null) {
closeSync(this.fd)
- delete this?.fd
+ delete this.fd
}
} catch (error) {
handleFileException(
}
private checkPerformanceRecordsFile (): void {
- if (this?.fd == null) {
+ if (this.fd == null) {
throw new BaseError(
`${this.logPrefix} Performance records '${this.dbName}' file descriptor not found`
)