export class MikroOrmStorage extends Storage {
private storageType: StorageType;
- private orm!: MikroORM | null;
+ private orm?: MikroORM;
constructor(storageUri: string, logPrefix: string, storageType: StorageType) {
super(storageUri, logPrefix);
this.dbName = this.getDBName();
}
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
public async storePerformanceStatistics(performanceStatistics: Statistics): Promise<void> {
try {
const performanceRecord = new PerformanceRecord();
try {
if (this?.orm) {
await this.orm.close();
- this.orm = null;
+ delete this?.orm;
}
} catch (error) {
this.handleDBError(this.storageType, error as Error);