bug fix
This commit is contained in:
parent
f092e2e447
commit
b97469fa21
@ -28,7 +28,7 @@ export class BlockSyncSvr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async execute() {
|
async execute() {
|
||||||
try {
|
// try {
|
||||||
let currentBlock = await retryEthBlockNumber(this.rpc)
|
let currentBlock = await retryEthBlockNumber(this.rpc)
|
||||||
let blockStr = await new RedisClient().get(this.redisKey)
|
let blockStr = await new RedisClient().get(this.redisKey)
|
||||||
if (blockStr) {
|
if (blockStr) {
|
||||||
@ -45,9 +45,9 @@ export class BlockSyncSvr {
|
|||||||
amount: this.batchCount
|
amount: this.batchCount
|
||||||
})
|
})
|
||||||
await this.processBlockDatas(blocks)
|
await this.processBlockDatas(blocks)
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
console.log(err)
|
// console.log(err)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
async processBlockDatas(iterator: any) {
|
async processBlockDatas(iterator: any) {
|
||||||
|
@ -41,7 +41,7 @@ export class EventBatchSvr {
|
|||||||
|
|
||||||
async execute() {
|
async execute() {
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
let currentBlock = await retryEthBlockNumber(this.rpc)
|
let currentBlock = await retryEthBlockNumber(this.rpc)
|
||||||
let toBlock = parseInt(currentBlock.result, 16)
|
let toBlock = parseInt(currentBlock.result, 16)
|
||||||
let blockStr = await new RedisClient().get(this.redisKey)
|
let blockStr = await new RedisClient().get(this.redisKey)
|
||||||
@ -111,9 +111,10 @@ export class EventBatchSvr {
|
|||||||
}
|
}
|
||||||
await new RedisClient().set(this.redisKey, nextBlock + '')
|
await new RedisClient().set(this.redisKey, nextBlock + '')
|
||||||
|
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
console.log(err)
|
// logger.error('sync events error: ', err.message || err)
|
||||||
}
|
// throw err
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
buildRedisKey(cfg: IEventCfg) {
|
buildRedisKey(cfg: IEventCfg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user