Skip to content

Commit

Permalink
chore(evmindexer): improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Nov 12, 2024
1 parent ec806e3 commit e3a781e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/cmd/evm_node_indexer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ func Run() {
updateBlockNumber(true, *noNewBlocks, time.Duration(*noNewBlocksThresholdSeconds)*time.Second, discordWebhookReportUrl, discordWebhookUser, discordWebhookAddTextFatal)
log.Infof("...get latest block (%s) from node done.", _formatInt64(currentNodeBlockNumber.Load()))

latestPGBlock, err := psqlGetLatestBlock(false)
if err != nil {
log.Fatal(err, "error while using psqlGetLatestBlock (start / read)", 0) // fatal, as if there is no initial value, we have nothing to start from
}

sendMessage(fmt.Sprintf("starting evmindexer for %s, version: %v, lastNodeBlock: %v, lastDbBlock: %v", getChainNamePretty(), version.Version, currentNodeBlockNumber.Load(), latestPGBlock), discordWebhookReportUrl, discordWebhookUser)

// //////////////////////////////////////////
// Config done, now actually "doing" stuff //
// //////////////////////////////////////////
Expand Down Expand Up @@ -330,7 +337,7 @@ func Run() {
}

// waiting for new blocks and export them, while checking reorg before every new block
latestPGBlock, err := psqlGetLatestBlock(false)
latestPGBlock, err = psqlGetLatestBlock(false)
if err != nil {
log.Fatal(err, "error while using psqlGetLatestBlock (start / read)", 0) // fatal, as if there is no initial value, we have nothing to start from
}
Expand Down

0 comments on commit e3a781e

Please sign in to comment.