|
|
|
|
@ -14,10 +14,10 @@ axiosRetry(axios, {
|
|
|
|
|
return delay;
|
|
|
|
|
},
|
|
|
|
|
retryCondition: error => {
|
|
|
|
|
return error.response?.status !== 200; // Retry only on non-200 status codes
|
|
|
|
|
return false; // error.response?.status !== 200; // Retry only on non-200 status codes
|
|
|
|
|
},
|
|
|
|
|
onRetry: (retryCount, error, requestConfig) => {
|
|
|
|
|
logger.warn({ retryCount, error, requestConfig }, `Retrying webhook call, attempt ${retryCount}`);
|
|
|
|
|
logger.warn({ retryCount, error: error.message, }, `Retrying webhook call, attempt ${retryCount}`);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -30,7 +30,7 @@ async function callWebhook(messageData) {
|
|
|
|
|
await axios.post(webhookUrl, messageData);
|
|
|
|
|
logger.info(JSON.stringify({ webhookUrl: webhookUrl, messageData }, undefined, 2), 'Webhook called successfully');
|
|
|
|
|
} catch (error) {
|
|
|
|
|
logger.error({ webhookUrl: webhookUrl, messageData, error }, 'Error calling webhook');
|
|
|
|
|
logger.error({ webhookUrl: webhookUrl, messageData, error: error.message }, 'Error calling webhook');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|