This commit is contained in:
aozhiwei 2023-07-05 19:41:03 +08:00
parent a929459db1
commit aa3863aeec
2 changed files with 11 additions and 1 deletions

View File

@ -43,6 +43,7 @@ class PullDbEvent extends BaseService {
this.eventConf = this.event['eventConf'];
this.progInfo = this.event['progressInfo'];
this.contractAddress = this.net.getContractAddressByName(this.getContractName());
this.progInfo['lastIdx'] = this.lastIdx.toString();
await this.start();
}
@ -199,6 +200,10 @@ class PullDbEvent extends BaseService {
}
}
getMaxIdx() {
return PullDbEvent.#maxIdx;
}
}
module.exports = PullDbEvent;

View File

@ -27,7 +27,9 @@ class DbSpider extends BaseTask {
'eventConf': eventConf,
'progressInfo': {
'pullCount': 0,
'eventCount': 0
'eventCount': 0,
'lastIdx': 0,
'maxIdx': 0
}
};
events.push(event);
@ -59,11 +61,14 @@ class DbSpider extends BaseTask {
(event) => {
const eventConf = event['eventConf'];
const progInfo = event['progressInfo'];
const pullService = event['pullDbEventService'];
const logObj = 'net_id: ' + net['net_id'] + ' ' +
eventConf['contract_name'] + '.' +
eventConf['event_name'] + ' ' +
' pullCount:' + progInfo['pullCount'] +
' eventCount:' + progInfo['eventCount'] +
' lastIdx:' + progInfo['lastIdx'] +
' maxIdx:' + pullService.getMaxIdx().toString() +
'';
log.info(logObj);
}