Skip to content

Commit

Permalink
fix: removed retry logic from v1 cm360 proxy handler
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik committed Dec 1, 2023
1 parent a015460 commit d786189
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/v1/destinations/campaign_manager/networkHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,6 @@ const {
} = require('../../../adapters/utils/networkUtils');
const tags = require('../../../v0/util/tags');

function isEventRetryableAndExtractErrMsg(element, proxyOutputObj) {
let isRetryable = false;
let errorMsg = '';
// success event
if (!element.errors) {
return isRetryable;
}
for (const err of element.errors) {
errorMsg += `${err.message}, `;
if (err.code === 'INTERNAL') {
isRetryable = true;
}
}
if (errorMsg) {
proxyOutputObj.error = errorMsg;
}
return isRetryable;
}

function isEventAbortableAndExtractErrMsg(element, proxyOutputObj) {
let isAbortable = false;
let errorMsg = '';
Expand Down Expand Up @@ -68,10 +49,8 @@ const responseHandler = (destinationResponse) => {
metadata: rudderJobMetadata[idx],
error: 'success',
};
// update status of partial event as per retriable or abortable
if (isEventRetryableAndExtractErrMsg(element, proxyOutputObj)) {
proxyOutputObj.statusCode = 500;
} else if (isEventAbortableAndExtractErrMsg(element, proxyOutputObj)) {
// update status of partial event if abortable
if (isEventAbortableAndExtractErrMsg(element, proxyOutputObj)) {
proxyOutputObj.statusCode = 400;
}
responseWithIndividualEvents.push(proxyOutputObj);
Expand Down

0 comments on commit d786189

Please sign in to comment.