This commit is contained in:
aozhiwei 2023-07-03 19:38:58 +08:00
parent 703d82ec44
commit 47752617dd

View File

@ -25,7 +25,7 @@ class PullBcEvent extends BaseService {
}
async pullEvent() {
const logHead = this.getInstanceName() + ' pullEvent:';
const logHead = this.getInstanceName() + ' pullEvent: ';
while (true) {
await this.bc.lockQuery();
try {
@ -78,7 +78,7 @@ class PullBcEvent extends BaseService {
}
async getFromBlock() {
const logHead = this.getInstanceName() + ' getFromBlock:';
const logHead = this.getInstanceName() + ' getFromBlock: ';
const firstBlockNumber = this.getInitBlock();
while (this.lastBlockNumber < 1) {
try {
@ -92,7 +92,7 @@ class PullBcEvent extends BaseService {
);
if (!err) {
if (row) {
this.lastBlockNumber = Number(row['value']);
this.lastBlockNumber = Number(row['block_number']);
} else {
this.lastBlockNumber = firstBlockNumber;
}
@ -125,7 +125,7 @@ class PullBcEvent extends BaseService {
}
async saveLastBlockNumber(blockNumber) {
const logHead = this.getInstanceName() + ' event_process.saveLastBlockNumber';
const logHead = this.getInstanceName() + ' event_process.saveLastBlockNumber: ';
while (true) {
const {err} = await this.conn.upsert(
't_last_block',
@ -155,7 +155,7 @@ class PullBcEvent extends BaseService {
}
async saveToDb(event) {
const logHead = this.getInstanceName() + ' event_process.saveToDb';
const logHead = this.getInstanceName() + ' event_process.saveToDb: ';
while (true) {
const nowTime = utils.getUtcTime();
const returnValues = event['returnValues'];