Skip to content

Commit

Permalink
Fix notification handler
Browse files Browse the repository at this point in the history
CS-5378
  • Loading branch information
MarijaIv committed Apr 26, 2024
1 parent 7622825 commit 5b1060f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions notification/src/handler/notification/notification.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ async function updatePaymentWithRepeater(
let retryCount = 0
let retryMessage
let updateActions
while (true) {
const repeater = async () => {
updateActions = await calculateUpdateActionsForPayment(
currentPayment,
notification,
logger,
)
if (updateActions.length === 0) {
break
return;
}
logger.debug(
`Update payment with key ${
Expand All @@ -110,7 +110,6 @@ async function updatePaymentWithRepeater(
logger.debug(
`Payment with key ${currentPayment.key} was successfully updated`,
)
break
} catch (err) {
const moduleConfig = config.getModuleConfig()
let updateActionsToLog = updateActions
Expand Down Expand Up @@ -141,6 +140,9 @@ async function updatePaymentWithRepeater(
)}`,
)
}

repeater();

/* eslint-disable-next-line no-await-in-loop */
const response = await ctpClient.fetchById(
ctpClient.builder.payments,
Expand All @@ -150,6 +152,8 @@ async function updatePaymentWithRepeater(
currentVersion = currentPayment.version
}
}

return repeater()
}

function _obfuscateNotificationInfoFromActionFields(updateActions) {
Expand Down

0 comments on commit 5b1060f

Please sign in to comment.