- FileUtils.handleFileException(this.logPrefix, 'Performance measurements', filePath, error);
+ FileUtils.handleFileException(this.logPrefix, Constants.PERFORMANCE_RECORDS_FILETYPE, this.dbName, error);
+ }
+ }
+
+ public close(): void {
+ try {
+ if (this.fd) {
+ fs.closeSync(this.fd);
+ this.fd = null;
+ }
+ } catch (error) {
+ FileUtils.handleFileException(this.logPrefix, Constants.PERFORMANCE_RECORDS_FILETYPE, this.dbName, error);
+ }
+ }
+
+ private checkPerformanceRecordsFile(): void {
+ if (!this.fd) {
+ throw new Error(`${this.logPrefix} Performance records '${this.dbName}' file descriptor not found`);