diff --git a/src/services/main/index.ts b/src/services/main/index.ts index 91bfd677..18860b99 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -85,6 +85,7 @@ export default class { this.applicationManager.Stop() this.paymentManager.Stop() this.utils.Stop() + this.storage.Stop() } StartBeacons() { diff --git a/src/services/main/unlocker.ts b/src/services/main/unlocker.ts index b482b470..1a5cd361 100644 --- a/src/services/main/unlocker.ts +++ b/src/services/main/unlocker.ts @@ -18,7 +18,7 @@ export class Unlocker { storage: Storage abortController = new AbortController() subbedToBackups = false - nodePub: string|null =null + nodePub: string | null = null log = getLogger({ component: "unlocker" }) constructor(settings: MainSettings, storage: Storage) { this.settings = settings @@ -133,7 +133,7 @@ export class Unlocker { return { ln, pub: info.pub } } - GetSeed = async (): Promise => { + GetSeed = async (): Promise => { if (!this.nodePub) { throw new Error("node pub not found") } @@ -259,7 +259,7 @@ export class Unlocker { await this.storage.liquidityStorage.SaveNodeBackup(pub, JSON.stringify(encryptedData)) this.log("new channel backup saved correctly") } catch (err: any) { - this.log("new channel backup was not saved") + this.log("new channel backup was not saved", err.message || err) } } }) diff --git a/src/services/storage/index.ts b/src/services/storage/index.ts index 842c8b66..ad214f5c 100644 --- a/src/services/storage/index.ts +++ b/src/services/storage/index.ts @@ -68,6 +68,10 @@ export default class { } } + Stop() { + this.dbs.disconnect() + } + StartTransaction(exec: TX, description?: string) { return this.dbs.Tx(tx => exec(tx), description) } diff --git a/src/tests/testRunner.ts b/src/tests/testRunner.ts index 0777d284..754d8c66 100644 --- a/src/tests/testRunner.ts +++ b/src/tests/testRunner.ts @@ -73,7 +73,7 @@ const runTestFile = async (fileName: string, mod: TestModule) => { await teardown(T) } catch (e: any) { d(e, true) - d("test crashed") + d("test crashed", true) await teardown(T) } if (mod.dev) {