This commit is contained in:
CounterFire2023 2024-01-15 17:18:38 +08:00
parent f092e2e447
commit b97469fa21
2 changed files with 9 additions and 8 deletions

View File

@ -28,7 +28,7 @@ export class BlockSyncSvr {
}
async execute() {
try {
// try {
let currentBlock = await retryEthBlockNumber(this.rpc)
let blockStr = await new RedisClient().get(this.redisKey)
if (blockStr) {
@ -45,9 +45,9 @@ export class BlockSyncSvr {
amount: this.batchCount
})
await this.processBlockDatas(blocks)
} catch (err) {
console.log(err)
}
// } catch (err) {
// console.log(err)
// }
}
async processBlockDatas(iterator: any) {

View File

@ -41,7 +41,7 @@ export class EventBatchSvr {
async execute() {
try {
// try {
let currentBlock = await retryEthBlockNumber(this.rpc)
let toBlock = parseInt(currentBlock.result, 16)
let blockStr = await new RedisClient().get(this.redisKey)
@ -111,9 +111,10 @@ export class EventBatchSvr {
}
await new RedisClient().set(this.redisKey, nextBlock + '')
} catch (err) {
console.log(err)
}
// } catch (err) {
// logger.error('sync events error: ', err.message || err)
// throw err
// }
}
buildRedisKey(cfg: IEventCfg) {