From 1e6e0336c319589b9d6f69debefde08d864042f6 Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Fri, 9 Jun 2023 16:47:14 +0800 Subject: [PATCH] fix: electron dev crash (#2746) --- apps/electron/layers/main/src/db/base-db-adapter.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/electron/layers/main/src/db/base-db-adapter.ts b/apps/electron/layers/main/src/db/base-db-adapter.ts index 268253ca79..581d283316 100644 --- a/apps/electron/layers/main/src/db/base-db-adapter.ts +++ b/apps/electron/layers/main/src/db/base-db-adapter.ts @@ -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) {