diff --git a/packages/core/src/evaluator/configRunner.ts b/packages/core/src/evaluator/configRunner.ts index 3de27ad..d0e58a9 100644 --- a/packages/core/src/evaluator/configRunner.ts +++ b/packages/core/src/evaluator/configRunner.ts @@ -49,9 +49,11 @@ export class ConfigRunner { baseUrl, apiToken, uuid: configId, - regFormSubmissionChunks: facilityProcessingChunks + regFormSubmissionChunks: facilityProcessingChunks, + editSubmissionChunks: facilityEditChunks } = config; const regFormSubmissionChunks = facilityProcessingChunks ?? 1000; + const editSubmissionsChunks = facilityEditChunks ?? 100; const startTime = Date.now(); const createMetric = createMetricFactory(startTime, configId); @@ -127,11 +129,10 @@ export class ConfigRunner { ); let cursor = 0; - const postChunks = 100; while (cursor <= updateRegFormSubmissionsPromises.length) { - const end = cursor + postChunks; + const end = cursor + editSubmissionsChunks; const chunksToSend = updateRegFormSubmissionsPromises.slice(cursor, end); - cursor = cursor + postChunks; + cursor = cursor + editSubmissionsChunks; await Promise.allSettled(chunksToSend.map((x) => x())); } } diff --git a/packages/core/src/helpers/types.ts b/packages/core/src/helpers/types.ts index c789d29..8cde712 100644 --- a/packages/core/src/helpers/types.ts +++ b/packages/core/src/helpers/types.ts @@ -38,6 +38,8 @@ export interface Config { schedule: CronTabString; // how many registration form submissions to process at a time. regFormSubmissionChunks?: number; + // out of regFormSubmissionChunk how many should be posted/edited at a time + editSubmissionChunks?: number; // store metric; progress information regarding a running pipeline or the last run of an pipeline writeMetric: WriteMetric; }