Skip to content
Snippets Groups Projects

fix(1442): Optimize BMA /tx/history

Merged Benoit Lavenier requested to merge fix/1442/1.8/optimize_bma_tx_history into release/1.8

Files

@@ -95,12 +95,16 @@ export class SQLiteDriver {
}
async destroyDatabase(): Promise<void> {
this.logger.debug("Removing SQLite database...");
this.logger.debug('Removing SQLite database "%s"...', this.path);
await this.closeConnection();
if (this.path !== MEMORY_PATH) {
await RealFS().fsUnlink(this.path);
}
this.logger.debug("Database removed");
this.logger.debug('Database "%s" removed', this.path);
}
get closed() {
return this.dbPromise;
}
async closeConnection(): Promise<void> {
@@ -112,9 +116,9 @@ export class SQLiteDriver {
db.open; // For an unknown reason, we need this line.
}
await new Promise((resolve, reject) => {
this.logger.debug("Trying to close SQLite...");
this.logger.debug('Closing SQLite database "%s"...', this.path);
db.on("close", () => {
this.logger.info("Database closed.");
this.logger.info('Database "%s" closed.', this.path);
this.dbPromise = null;
resolve();
});
Loading