Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back Merge #2293

Merged
merged 9 commits into from
Jun 19, 2024
Prev Previous commit
Next Next commit
fix(ihev2): ms in location its used
Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
  • Loading branch information
jonahkaye committed Jun 18, 2024
commit 71430a592c9543319e746c75e5f19d7b37e9eb01
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import duration from "dayjs/plugin/duration";

dayjs.extend(duration);

const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs
.duration({ seconds: 1 })
.asMilliseconds();
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 });
const MAX_GATEWAYS_BEFORE_CHUNK = 1000;
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20;
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20;
Expand Down Expand Up @@ -120,7 +118,7 @@ export class IHEGatewayV2Async extends IHEGatewayV2 {
const params = { patientId, cxId, requestId, drRequestsGatewayV2: chunk };

if (i > 0) {
await sleep(SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS);
await sleep(SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS.asMilliseconds());
}

// intentionally not waiting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
dayjs.extend(duration);

const { log } = out("Saml Client");
const httpTimeout = dayjs.duration({ seconds: 120 }).asMilliseconds();
const initialDelay = dayjs.duration({ seconds: 3 }).asMilliseconds();
const httpTimeout = dayjs.duration({ seconds: 120 });
const initialDelay = dayjs.duration({ seconds: 3 });
const maxPayloadSize = Infinity;
let rejectUnauthorized = true;
let trustedStore: string | undefined = undefined;
Expand Down Expand Up @@ -89,7 +89,7 @@ export async function sendSignedXml({
const response = await executeWithNetworkRetries(
async () => {
return axios.post(url, signedXml, {
timeout: httpTimeout,
timeout: httpTimeout.asMilliseconds(),
headers: {
"Content-Type": "application/soap+xml;charset=UTF-8",
Accept: "application/soap+xml",
Expand All @@ -99,7 +99,7 @@ export async function sendSignedXml({
});
},
{
initialDelay: initialDelay,
initialDelay: initialDelay.asMilliseconds(),
maxAttempts: 3,
//TODO: This introduces retry on timeout without needing to specify the http Code: https://github.com/metriport/metriport/pull/2285. Remove once PR is merged
httpCodesToRetry: ["ECONNREFUSED", "ECONNRESET", "ETIMEDOUT"],
Expand Down Expand Up @@ -134,7 +134,7 @@ export async function sendSignedXmlMtom({
const response = await executeWithNetworkRetries(
async () => {
return axios.post(url, payload, {
timeout: httpTimeout,
timeout: httpTimeout.asMilliseconds(),
headers: {
"Accept-Encoding": "gzip, deflate",
"Content-Type": contentType,
Expand All @@ -147,7 +147,7 @@ export async function sendSignedXmlMtom({
});
},
{
initialDelay: initialDelay,
initialDelay: initialDelay.asMilliseconds(),
maxAttempts: 4,
//TODO: This introduces retry on timeout without needing to specify the http Code: https://github.com/metriport/metriport/pull/2285. Remove once PR is merged
httpCodesToRetry: [
Expand Down
Loading