diff --git a/src/services/ldb.services.js b/src/services/ldb.services.js index 98cc786..724bf2f 100644 --- a/src/services/ldb.services.js +++ b/src/services/ldb.services.js @@ -141,6 +141,7 @@ async function staffApiCallRetry(api, method, options, retries) { logger.warn(err, "DNS ERR") if (i < retries - 1) { logger.debug('Retrying API Call') + await delay(500) continue; } } @@ -150,6 +151,10 @@ async function staffApiCallRetry(api, method, options, retries) { throw new Error("Max retries exceeded"); } +function delay(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + async function getReasonCodeList() { logger.debug("ldbService.getReasonCodeList: Fetching reason code list"); try {