stop subp

This commit is contained in:
boufni95 2025-03-10 19:56:40 +00:00
parent 95c7502dc2
commit ef811e4bf5
4 changed files with 9 additions and 4 deletions

View file

@ -85,6 +85,7 @@ export default class {
this.applicationManager.Stop() this.applicationManager.Stop()
this.paymentManager.Stop() this.paymentManager.Stop()
this.utils.Stop() this.utils.Stop()
this.storage.Stop()
} }
StartBeacons() { StartBeacons() {

View file

@ -18,7 +18,7 @@ export class Unlocker {
storage: Storage storage: Storage
abortController = new AbortController() abortController = new AbortController()
subbedToBackups = false subbedToBackups = false
nodePub: string|null =null nodePub: string | null = null
log = getLogger({ component: "unlocker" }) log = getLogger({ component: "unlocker" })
constructor(settings: MainSettings, storage: Storage) { constructor(settings: MainSettings, storage: Storage) {
this.settings = settings this.settings = settings
@ -133,7 +133,7 @@ export class Unlocker {
return { ln, pub: info.pub } return { ln, pub: info.pub }
} }
GetSeed = async (): Promise<Types.LndSeed> => { GetSeed = async (): Promise<Types.LndSeed> => {
if (!this.nodePub) { if (!this.nodePub) {
throw new Error("node pub not found") throw new Error("node pub not found")
} }
@ -259,7 +259,7 @@ export class Unlocker {
await this.storage.liquidityStorage.SaveNodeBackup(pub, JSON.stringify(encryptedData)) await this.storage.liquidityStorage.SaveNodeBackup(pub, JSON.stringify(encryptedData))
this.log("new channel backup saved correctly") this.log("new channel backup saved correctly")
} catch (err: any) { } catch (err: any) {
this.log("new channel backup was not saved") this.log("new channel backup was not saved", err.message || err)
} }
} }
}) })

View file

@ -68,6 +68,10 @@ export default class {
} }
} }
Stop() {
this.dbs.disconnect()
}
StartTransaction<T>(exec: TX<T>, description?: string) { StartTransaction<T>(exec: TX<T>, description?: string) {
return this.dbs.Tx(tx => exec(tx), description) return this.dbs.Tx(tx => exec(tx), description)
} }

View file

@ -73,7 +73,7 @@ const runTestFile = async (fileName: string, mod: TestModule) => {
await teardown(T) await teardown(T)
} catch (e: any) { } catch (e: any) {
d(e, true) d(e, true)
d("test crashed") d("test crashed", true)
await teardown(T) await teardown(T)
} }
if (mod.dev) { if (mod.dev) {