fix: electron dev crash (#2746)

(cherry picked from commit 1e6e0336c3)
This commit is contained in:
Peng Xiao
2023-06-09 16:47:14 +08:00
committed by Alex Yang
parent af205cde7c
commit a21067db17
@@ -23,8 +23,9 @@ export abstract class BaseSQLiteAdapter {
async destroy() {
const { db } = this;
this.db = null;
await db?.close();
// log after close will sometimes crash the app when quitting
logger.info(`[SQLiteAdapter:${this.role}]`, 'destroyed:', this.path);
await db?.close();
}
async addBlob(key: string, data: Uint8Array) {