Skip to content

Commit 4167db9

Browse files
author
James Cori
committed
Removing the retries
1 parent 988c2d1 commit 4167db9

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/app.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,21 @@ const dataHandler = async (messageSet, topic, partition) => Promise.each(message
5858
if (isNil(challengeId)) {
5959
throw new Error(`Challenge ID ${challengeId} is null, will not queue to retry`)
6060
} else {
61-
const retryCountIdentifier = `${config.KAFKA_GROUP_ID.split(' ').join('_')}_retry_count`
62-
let currentRetryCount = parseInt(get(messageJSON.payload, retryCountIdentifier, 1), 10)
63-
if (currentRetryCount <= config.MAX_RETRIES) {
64-
logger.info(`Challenge does not exist yet. Will post the same message back to the bus API and retry in ${currentRetryCount * (config.RETRY_TIMEOUT / 1000)} seconds`)
65-
await new Promise((resolve) => {
66-
setTimeout(async () => {
67-
currentRetryCount += 1
68-
await helper.postBusEvent(topic, { ...messageJSON.payload, [retryCountIdentifier]: currentRetryCount })
69-
resolve()
70-
}, config.RETRY_TIMEOUT * currentRetryCount)
71-
})
72-
} else {
73-
logger.error(`Failed to process message after ${config.MAX_RETRIES} retries. Aborting...`)
74-
}
61+
logger.warn(`Creating resource failed, no legacy challenge found for ${challengeId} - Retry disabled`)
62+
// const retryCountIdentifier = `${config.KAFKA_GROUP_ID.split(' ').join('_')}_retry_count`
63+
// let currentRetryCount = parseInt(get(messageJSON.payload, retryCountIdentifier, 1), 10)
64+
// if (currentRetryCount <= config.MAX_RETRIES) {
65+
// logger.info(`Challenge does not exist yet. Will post the same message back to the bus API and retry in ${currentRetryCount * (config.RETRY_TIMEOUT / 1000)} seconds`)
66+
// await new Promise((resolve) => {
67+
// setTimeout(async () => {
68+
// currentRetryCount += 1
69+
// await helper.postBusEvent(topic, { ...messageJSON.payload, [retryCountIdentifier]: currentRetryCount })
70+
// resolve()
71+
// }, config.RETRY_TIMEOUT * currentRetryCount)
72+
// })
73+
// } else {
74+
// logger.error(`Failed to process message after ${config.MAX_RETRIES} retries. Aborting...`)
75+
// }
7576
}
7677
}
7778
// only commit if no errors

0 commit comments

Comments
 (0)