@azure/identity 4.5.0-alpha.20240912.2 → 4.5.0-alpha.20240916.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1397,14 +1397,10 @@ function imdsRetryPolicy(msiRetryConfig) {
1397
1397
  if ((response === null || response === void 0 ? void 0 : response.status) !== 404) {
1398
1398
  return { skipStrategy: true };
1399
1399
  }
1400
- // Exponentially increase the delay each time
1401
- const exponentialDelay = msiRetryConfig.startDelayInMs * Math.pow(2, retryCount);
1402
- // Don't let the delay exceed the maximum
1403
- const clampedExponentialDelay = Math.min(DEFAULT_CLIENT_MAX_RETRY_INTERVAL, exponentialDelay);
1404
- // Allow the final value to have some "jitter" (within 50% of the delay size) so
1405
- // that retries across multiple clients don't occur simultaneously.
1406
- const retryAfterInMs = clampedExponentialDelay / 2 + coreUtil.getRandomIntegerInclusive(0, clampedExponentialDelay / 2);
1407
- return { retryAfterInMs };
1400
+ return coreUtil.calculateRetryDelay(retryCount, {
1401
+ retryDelayInMs: msiRetryConfig.startDelayInMs,
1402
+ maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL,
1403
+ });
1408
1404
  },
1409
1405
  },
1410
1406
  ], {