This commit is contained in:
aozhiwei 2023-07-04 20:48:48 +08:00
parent 73107aaf57
commit e5806b12d2

View File

@ -6,10 +6,9 @@ const BaseService = require('./baseservice');
class PullDbEvent extends BaseService { class PullDbEvent extends BaseService {
async init(bc, net, event) { async init(net, event) {
const {err, conn} = await app.getDbConn('BcEventDb0'); const {err, conn} = await app.getDbConn('BcEventDb0');
this.conn = conn; this.conn = conn;
this.lastBlockNumber = 0;
this.net = net; this.net = net;
this.event = event; this.event = event;
this.eventConf = this.event['eventConf']; this.eventConf = this.event['eventConf'];
@ -20,7 +19,7 @@ class PullDbEvent extends BaseService {
async start() { async start() {
while (true) { while (true) {
await this.pullEvent(); await this.pullEvent();
await utils.sleep(8000 + utils.randRange(500, 1500)); await utils.sleep(500 + utils.randRange(500, 1500));
} }
} }
@ -33,7 +32,7 @@ class PullDbEvent extends BaseService {
} }
getContractAddress() { getContractAddress() {
return this.bc.getContractAddressByName(this.getContractName()); //return this.bc.getContractAddressByName(this.getContractName());
} }
getContractName() { getContractName() {