Skip to content

Commit

Permalink
define separate logPrefix var in latestJob
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed May 28, 2024
1 parent 6dd356b commit 8b64040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/listener/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ function latestJob({
observedBlock = Math.max(0, latestBlock - 1)
}

let logPrefix = generateListenerLogPrefix(contractAddress, observedBlock, latestBlock)
try {
const logPrefix = generateListenerLogPrefix(contractAddress, observedBlock, latestBlock)
if (latestBlock > observedBlock) {
// create record for each block in unprocessed_blocks table
// dont include observedBlock as it's considered processed
Expand Down Expand Up @@ -265,7 +265,7 @@ function latestJob({
// failed. Repeateable [latest] job will continue listening for
// new blocks, and the blocks which failed to be scanned for
// events will be retried through [history] job.
logPrefix = generateListenerLogPrefix(contractAddress, observedBlock, latestBlock)
const logPrefix = generateListenerLogPrefix(contractAddress, observedBlock, latestBlock)
logger.warn(`${logPrefix} fail`)

for (let blockNumber = observedBlock + 1; blockNumber <= latestBlock; ++blockNumber) {
Expand Down

0 comments on commit 8b64040

Please sign in to comment.