extractPadData: Fix wrong DB get function

pull/5476/head
Tom Kunze 2022-03-21 06:29:12 +01:00 committed by Richard Hansen
parent a11cf67de7
commit 49c7a4ba82
1 changed files with 2 additions and 4 deletions

View File

@ -30,9 +30,7 @@ const padId = process.argv[2];
// initialize output database
const dirty = dirtyDB(`${padId}.db`);
// Promise wrapped get and set function
const wrapped = db.db.db.wrappedDB;
const get = util.promisify(wrapped.get.bind(wrapped));
// Promise set function
const set = util.promisify(dirty.set.bind(dirty));
// array in which required key values will be accumulated
@ -55,7 +53,7 @@ const padId = process.argv[2];
}
for (const dbkey of neededDBValues) {
let dbvalue = await get(dbkey);
let dbvalue = await db.get(dbkey);
if (dbvalue && typeof dbvalue !== 'object') {
dbvalue = JSON.parse(dbvalue);
}