1
This commit is contained in:
parent
46c85f4ce0
commit
567a0cc278
@ -47,6 +47,9 @@ class DbEventProcess extends BaseService {
|
||||
this.lastIdx = BigInt(0);
|
||||
this.eventConf = this.event['eventConf'];
|
||||
this.progInfo = this.event['progressInfo'];
|
||||
this.contractAddress = this.net.getContractAddressByName(this.getContractName());
|
||||
this.lastIdx = await this.getLastIdx();
|
||||
this.progInfo['lastIdx'] = this.lastIdx.toString();
|
||||
await this.start();
|
||||
}
|
||||
|
||||
@ -153,6 +156,10 @@ class DbEventProcess extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
getMaxIdx() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = DbEventProcess;
|
||||
|
@ -28,12 +28,18 @@ class DbSpider extends BaseTask {
|
||||
'progressInfo': {
|
||||
'pullCount': 0,
|
||||
'eventCount': 0,
|
||||
'lastIdx': 0,
|
||||
'maxIdx': 0
|
||||
'pullLastIdx': 0,
|
||||
'pullMaxIdx': 0,
|
||||
|
||||
'procPullCount': 0,
|
||||
'procEventCount': 0,
|
||||
'procLastIdx': 0,
|
||||
'procmaxIdx': 0
|
||||
}
|
||||
};
|
||||
events.push(event);
|
||||
this.createPullDbEventService(net, event);
|
||||
this.createDbEventProcessService(net, event);
|
||||
});
|
||||
this.outputProgressInfo(net, events);
|
||||
}
|
||||
@ -47,7 +53,7 @@ class DbSpider extends BaseTask {
|
||||
|
||||
createDbEventProcessService(net, event) {
|
||||
const DbEventProcessService = serviceFactory.create('DbEventProcess');
|
||||
event['DbEventProcessService'] = DbEventProcessService;
|
||||
event['dbEventProcessService'] = DbEventProcessService;
|
||||
DbEventProcessService.init(net, event);
|
||||
return DbEventProcessService;
|
||||
}
|
||||
@ -63,13 +69,19 @@ class DbSpider extends BaseTask {
|
||||
const eventConf = event['eventConf'];
|
||||
const progInfo = event['progressInfo'];
|
||||
const pullService = event['pullDbEventService'];
|
||||
const procService = event['dbEventProcessService'];
|
||||
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() +
|
||||
' A_pullCount:' + progInfo['pullCount'] +
|
||||
' A_eventCount:' + progInfo['eventCount'] +
|
||||
' A_lastIdx:' + progInfo['pullLastIdx'] +
|
||||
' A_maxIdx:' + pullService.getMaxIdx().toString() +
|
||||
|
||||
' B_pullCount:' + progInfo['procPullCount'] +
|
||||
' B_eventCount:' + progInfo['procEventCount'] +
|
||||
' B_lastIdx:' + progInfo['procLastIdx'] +
|
||||
' B_maxIdx:' + procService.getMaxIdx().toString() +
|
||||
'';
|
||||
log.info(logObj);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user