Skip to content

Commit

Permalink
added config for retry for resource creation completion (#1333)
Browse files Browse the repository at this point in the history
* added config

* removed hardcoded retry limit
  • Loading branch information
nitish-egov authored Jan 9, 2025
1 parent 97b4b32 commit b5be48e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions health-services/project-factory/src/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit b5be48e

Please sign in to comment.