Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit b4a6530

Browse files
committed
Fixing the retry code
1 parent cc10187 commit b4a6530

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/services/ProcessorService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,15 @@ async function processUpdate (message) {
383383
logger.error(`Error: ${JSON.stringify(e)}`)
384384

385385
const retryCountIdentifier = `${config.KAFKA_GROUP_ID.split(' ').join('_')}_retry_count`
386-
let currentRetryCount = parseInt(get(messageJSON.payload, retryCountIdentifier, 1), 10)
386+
const currentRetryCount = parseInt(_.get(message.payload, retryCountIdentifier, 1), 10)
387387
if (currentRetryCount <= config.MAX_RETRIES) {
388388
await new Promise((resolve) => {
389389
setTimeout(async () => {
390-
await helper.postBusEvent(config.UPDATE_CHALLENGE_TOPIC, { ...messageJSON.payload, [retryCountIdentifier]: currentRetryCount })
390+
await helper.postBusEvent(config.UPDATE_CHALLENGE_TOPIC, { ...message.payload, [retryCountIdentifier]: currentRetryCount })
391391
resolve()
392392
}, config.RETRY_TIMEOUT * currentRetryCount)
393393
})
394-
} else {
394+
} else {
395395
logger.error(`Failed to process message after ${config.MAX_RETRIES} retries. Aborting...`)
396396
}
397397
return

0 commit comments

Comments
 (0)