Skip to content

Commit

Permalink
feat(ihe): add retries for bad response
Browse files Browse the repository at this point in the history
Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
  • Loading branch information
jonahkaye committed Jun 20, 2024
1 parent d667096 commit 0b9489f
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ export async function createSignSendProcessXCPDRequest({
for (const result of results) {
try {
// TODO not sure if we should retry on timeout
await executeWithNetworkRetries(async () => axios.post(pdResponseUrl, result));
await executeWithNetworkRetries(async () => axios.post(pdResponseUrl, result), {
httpCodesToRetry: ["ERR_BAD_RESPONSE"],
});
} catch (error) {
const msg = "Failed to send PD response to internal CQ endpoint";
const extra = { cxId, patientId, result };
Expand Down Expand Up @@ -167,7 +169,9 @@ export async function createSignSendProcessDqRequests({
for (const result of successfulResults) {
try {
// TODO not sure if we should retry on timeout
await executeWithNetworkRetries(async () => axios.post(dqResponseUrl, result));
await executeWithNetworkRetries(async () => axios.post(dqResponseUrl, result), {
httpCodesToRetry: ["ERR_BAD_RESPONSE"],
});
} catch (error) {
const msg = "Failed to send DQ response to internal CQ endpoint";
const extra = { cxId, patientId, result };
Expand Down Expand Up @@ -217,7 +221,9 @@ export async function createSignSendProcessDrRequests({
for (const result of successfulResults) {
try {
// TODO not sure if we should retry on timeout
await executeWithNetworkRetries(async () => axios.post(drResponseUrl, result));
await executeWithNetworkRetries(async () => axios.post(drResponseUrl, result), {
httpCodesToRetry: ["ERR_BAD_RESPONSE"],
});
} catch (error) {
const msg = "Failed to send DR response to internal CQ endpoint";
const extra = { cxId, patientId, result };
Expand Down

0 comments on commit 0b9489f

Please sign in to comment.