1
This commit is contained in:
parent
d0111af164
commit
e70f0a5086
@ -218,7 +218,11 @@ class DbEventProcess extends BaseService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const handle = eventsFactory.createEventHandle(this, this.conn, row);
|
const handle = eventsFactory.createEventHandle(this, this.conn, row);
|
||||||
|
try {
|
||||||
await handle.start();
|
await handle.start();
|
||||||
|
} finally {
|
||||||
|
await handle.safeRelease();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,17 @@ class BaseEventProcess {
|
|||||||
this.conn = conn;
|
this.conn = conn;
|
||||||
this.eventDb = eventDb;
|
this.eventDb = eventDb;
|
||||||
this.returnValues = utils.jsonDecode(this.getEventDb()['return_values']);
|
this.returnValues = utils.jsonDecode(this.getEventDb()['return_values']);
|
||||||
|
this.bcEventConn = null;
|
||||||
|
this.bcNftConn = null;
|
||||||
|
this.gameConn = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async safeRelease() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
genLogHead(msg) {
|
genLogHead(msg) {
|
||||||
@ -130,6 +141,23 @@ class BaseEventProcess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async bcEventDbConn(method, ...args) {
|
||||||
|
const conn = await this.getMarketDb();
|
||||||
|
const ret = await conn[method](...args);
|
||||||
|
if (ret.err){
|
||||||
|
this.throwError(500, 'internal error');
|
||||||
|
log.error(ret.err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (utils.hasKey(ret, 'row')) {
|
||||||
|
return ret['row'];
|
||||||
|
} else if (utils.hasKey(ret, 'rows')) {
|
||||||
|
return ret['rows'];
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BaseEventProcess;
|
module.exports = BaseEventProcess;
|
||||||
|
2
third_party/j7
vendored
2
third_party/j7
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 22eef8b27c64e0970dc96e96496b51bffc42c7c8
|
Subproject commit ce576bd6ff46b5ce4836d786a7670f545916665f
|
Loading…
x
Reference in New Issue
Block a user