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() { 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) {

View File

@ -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) {