Skip to content

Commit

Permalink
fix: SJIP-626 fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
celinepelletier committed Oct 31, 2023
1 parent 8aad94e commit 09ee710
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable no-console */
import noop from 'lodash/noop';

import { Client } from '@elastic/elasticsearch';
import { buildQuery } from '@arranger/middleware';
import xl from 'excel4node';
Expand Down Expand Up @@ -43,8 +45,8 @@ export default async function generateFiles(

const searchParams = await makeReportQuery(extendedConfig, sqon, wantedFields, userId, accessToken);

console.time(`biospecimen request search`);
try {
console.time(`biospecimen request search`);
await executeSearchAfterQuery(es, normalizedConfigs.alias, searchParams, {
onPageFetched: rawChunk => {
for (const row of rawChunk) {
Expand Down Expand Up @@ -77,15 +79,14 @@ export default async function generateFiles(
workSheetWrappers.set(study_code, { rowIndex: currentRowIndex + 1 });
}
},
onFinish: () => {
// Do Nothing
},
onFinish: noop,
pageSize: Number(env.ES_PAGESIZE),
});
console.timeEnd(`biospecimen request search`);
} catch (err) {
console.error(`Error while fetching the data for biospecimen request`);
throw err;
} finally {
console.timeEnd(`biospecimen request search`);
}

// Writes the file on the server
Expand Down

0 comments on commit 09ee710

Please sign in to comment.