diff --git a/health-services/project-factory/src/server/config/index.ts b/health-services/project-factory/src/server/config/index.ts index 954a029d9b..814c20ea81 100644 --- a/health-services/project-factory/src/server/config/index.ts +++ b/health-services/project-factory/src/server/config/index.ts @@ -19,6 +19,7 @@ const getDBSchemaName = (dbSchema = "") => { const config = { batchSize:100, cacheTime: 300, + retryUntilResourceCreationComplete:process.env.RETRY_TILL_RESOURCE_CREATION_COMPLETES || 100, isProduction: process.env ? true : false, token: "", // add default token if core services are not port forwarded enableDynamicTemplateFor: process.env.ENABLE_DYNAMIC_TEMPLATE_FOR || "", diff --git a/health-services/project-factory/src/server/utils/campaignMappingUtils.ts b/health-services/project-factory/src/server/utils/campaignMappingUtils.ts index 4bf68da294..eaf6381680 100644 --- a/health-services/project-factory/src/server/utils/campaignMappingUtils.ts +++ b/health-services/project-factory/src/server/utils/campaignMappingUtils.ts @@ -509,7 +509,7 @@ async function processCampaignMapping(messageObject: any) { var completedResources: any = [] var resources = []; for (const resourceDetailId of resourceDetailsIds) { - var retry = 75; + var retry: any = config?.retryUntilResourceCreationComplete; while (retry--) { const response = await searchResourceDetailsById(resourceDetailId, messageObject); logger.info(`response for resourceDetailId: ${resourceDetailId}`); diff --git a/health-services/project-factory/src/server/utils/campaignUtils.ts b/health-services/project-factory/src/server/utils/campaignUtils.ts index f5efd72ca4..5bd83c6815 100644 --- a/health-services/project-factory/src/server/utils/campaignUtils.ts +++ b/health-services/project-factory/src/server/utils/campaignUtils.ts @@ -3216,7 +3216,7 @@ const autoGenerateBoundaryCodes = async ( latLongData = result.latLongData; boundaryData = result.updatedData; } - const updatedBoundaryData = updateBoundaryData(boundaryData, hierarchy); + const updatedBoundaryData = updateBoundaryData(boundaryData, localizedHeadersOfBoundarySheet); const modifiedBoundaryData = modifyBoundaryDataHeaders( updatedBoundaryData, hierarchy,