From 8deabb56dd56b973e60f0c6a8d7b2957607bbd5e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 12 Oct 2022 17:37:52 +0100 Subject: [PATCH] Quick fixes to DB TS conversion. --- packages/backend-core/src/db/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend-core/src/db/index.ts b/packages/backend-core/src/db/index.ts index 2728b83682..7a2337359a 100644 --- a/packages/backend-core/src/db/index.ts +++ b/packages/backend-core/src/db/index.ts @@ -40,7 +40,7 @@ export async function init(opts?: PouchOptions) { // NOTE: THIS IS A DANGEROUS FUNCTION - USE WITH CAUTION // this function is prone to leaks, should only be used // in situations that using the function doWithDB does not work -export async function dangerousGetDB(dbName: string, opts?: any) { +export function dangerousGetDB(dbName: string, opts?: any) { checkInitialised() if (env.isTest()) { dbList.add(dbName) @@ -75,13 +75,13 @@ export async function closeDB(db: PouchDB.Database) { // the DB when we're done, without this manual requests would // need to close the database when done with it to avoid memory leaks export async function doWithDB(dbName: string, cb: any, opts = {}) { - const db = exports.dangerousGetDB(dbName, opts) + const db = dangerousGetDB(dbName, opts) // need this to be async so that we can correctly close DB after all // async operations have been completed try { return await cb(db) } finally { - await exports.closeDB(db) + await closeDB(db) } }