1
This commit is contained in:
parent
923bfc21b8
commit
f06a1967a9
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user