This commit is contained in:
aozhiwei 2023-07-10 15:19:38 +08:00
parent 923bfc21b8
commit f06a1967a9
2 changed files with 5 additions and 4 deletions

View File

@ -12,7 +12,7 @@ class DbEventProcess extends BaseService {
static #tableMaxIdxHash = {};
static async staticInit() {
const {err, conn} = await app.getDbConn('BcEventDb0');
const {err, conn} = await app.getDbConn(constant.BCEVENTDB_NAME);
const tables = metaFactory.getAllTables();
await utils.serial
(
@ -49,7 +49,7 @@ class DbEventProcess extends BaseService {
this.eventConf = this.event['eventConf'];
this.progInfo = this.event['progressInfo'];
this.contractAddress = this.net.getContractAddressByName(this.getContractName());
const {err, conn} = await app.getDbConn('BcEventDb0');
const {err, conn} = await app.getDbConn(constant.BCEVENTDB_NAME);
this.conn = conn;
this.lastIdx = await this.getLastIdx();
this.progInfo['proclastIdx'] = this.lastIdx.toString();

View File

@ -2,6 +2,7 @@ const app = require('j7/app');
const utils = require('j7/utils');
const bcutils = require('j7/bcutils');
const log = require('j7/log');
const constant = require('common/constant');
const BaseService = require('./baseservice');
const LIMIT_COUNT = 100;
@ -12,7 +13,7 @@ class PullDbEvent extends BaseService {
static #maxIdx = BigInt(0);
static async staticInit() {
const {err, conn} = await app.getDbConn('BcEventDb0');
const {err, conn} = await app.getDbConn(constant.BCEVENTDB_NAME);
{
const {err, maxIdx} = await conn.getMaxIdx(BCEVENT_TABLE_NAME);
if (err) {
@ -35,7 +36,7 @@ class PullDbEvent extends BaseService {
}
async init(net, event) {
const {err, conn} = await app.getDbConn('BcEventDb0');
const {err, conn} = await app.getDbConn(constant.BCEVENTDB_NAME);
this.conn = conn;
this.net = net;
this.event = event;