Skip to content

Commit

Permalink
Merge pull request #2300 from metriport/patch-pd-lambda-timeout
Browse files Browse the repository at this point in the history
Patch pd lambda timeout
  • Loading branch information
jonahkaye committed Jun 19, 2024
2 parents 9b0256f + e7bf7d8 commit eeb6a35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
dayjs.extend(duration);

const { log } = out("Saml Client");
const httpTimeout = dayjs.duration({ seconds: 120 });
const httpTimeoutPatientDiscovery = dayjs.duration({ seconds: 60 });
const httpTimeoutDocumentQuery = dayjs.duration({ seconds: 120 });
const httpTimeoutDocumentRetrieve = dayjs.duration({ seconds: 120 });
const initialDelay = dayjs.duration({ seconds: 3 });
const maxPayloadSize = Infinity;
let rejectUnauthorized = true;
Expand Down Expand Up @@ -91,7 +93,9 @@ export async function sendSignedXml({
const response = await executeWithNetworkRetries(
async () => {
return axios.post(url, signedXml, {
timeout: httpTimeout.asMilliseconds(),
timeout: isDq
? httpTimeoutDocumentQuery.asMilliseconds()
: httpTimeoutPatientDiscovery.asMilliseconds(),
headers: {
"Content-Type": "application/soap+xml;charset=UTF-8",
Accept: "application/soap+xml",
Expand Down Expand Up @@ -136,7 +140,7 @@ export async function sendSignedXmlMtom({
const response = await executeWithNetworkRetries(
async () => {
return axios.post(url, payload, {
timeout: httpTimeout.asMilliseconds(),
timeout: httpTimeoutDocumentRetrieve.asMilliseconds(),
headers: {
"Accept-Encoding": "gzip, deflate",
"Content-Type": contentType,
Expand Down
4 changes: 2 additions & 2 deletions packages/infra/lib/ihe-gateway-v2-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class IHEGatewayV2LambdasNestedStack extends NestedStack {
},
layers: [lambdaLayers.shared],
memory: 4096,
timeout: Duration.minutes(5),
timeout: Duration.minutes(10),
vpc,
});

Expand Down Expand Up @@ -200,7 +200,7 @@ export class IHEGatewayV2LambdasNestedStack extends NestedStack {
},
layers: [lambdaLayers.shared],
memory: 1024,
timeout: Duration.minutes(5),
timeout: Duration.minutes(10),
vpc,
});

Expand Down

0 comments on commit eeb6a35

Please sign in to comment.