This commit is contained in:
aozhiwei 2023-07-13 15:01:40 +08:00
parent 875f15dc8d
commit b324ba2e7f

View File

@ -42,9 +42,9 @@ async function internalCreateConn(app, name) {
return dbObj.conn; return dbObj.conn;
} }
async function getBcEventConn(app, method, ...args) { async function internalDbConn(app, name, method, ...args) {
try { try {
const conn = await internalCreateConn(app, constant.BCEVENTDB_NAME); const conn = await internalCreateConn(app, name);
const ret = await conn[method](...args); const ret = await conn[method](...args);
if (ret.err) { if (ret.err) {
return { return {
@ -54,15 +54,24 @@ async function getBcEventConn(app, method, ...args) {
'rows': null 'rows': null
}; };
} }
} catch (err) {
return { return {
'err': err, 'err': null,
'conn': null, 'conn': null,
'row': null, 'row': ret.hasOwnProperty('row') ? ret['row'] : null,
'rows': null 'rows': ret.hasOwnProperty('rows') ? ret['rows'] : null,
}; };
} } catch (err) {
return {
'err': err,
'conn': null,
'row': null,
'rows': null
};
};
}
async function getBcEventConn(app, method, ...args) {
const conn = await internalCreateConn(app, constant.BCEVENTDB_NAME);
} }
async function getBcNftConn(app, method, ...args) { async function getBcNftConn(app, method, ...args) {