This commit is contained in:
aozhiwei 2023-07-11 16:32:17 +08:00
parent e7294a5465
commit d82546500b

View File

@ -214,15 +214,24 @@ class DbEventProcess extends BaseService {
} }
async process(row) { async process(row) {
const logHead = this.getInstanceName() + ' process: ';
if (!this.eventHandle) { if (!this.eventHandle) {
return false; return false;
} }
while (true) {
try {
const handle = eventsFactory.createEventHandle(this, this.conn, row); const handle = eventsFactory.createEventHandle(this, this.conn, row);
try { try {
await handle.start(); await handle.start();
} finally { } finally {
await handle.safeRelease(); await handle.safeRelease();
} }
} catch (err) {
utils.safeDumpErrStack(err);
log.error(logHead + err);
await utils.sleep(5000 + utils.randRange(500, 1500));
}
}
return true; return true;
} }