From 8b640405abcb0e4f2d6afc6ba7c5610cfebef206 Mon Sep 17 00:00:00 2001 From: Intizar Date: Tue, 28 May 2024 15:13:20 +0900 Subject: [PATCH] define separate logPrefix var in latestJob --- core/src/listener/listener.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/listener/listener.ts b/core/src/listener/listener.ts index f202fbde4..fe530fa64 100644 --- a/core/src/listener/listener.ts +++ b/core/src/listener/listener.ts @@ -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 @@ -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) {