Skip to content

Commit

Permalink
Fix type conversion error
Browse files Browse the repository at this point in the history
  • Loading branch information
mkht committed May 11, 2023
1 parent ba5d55b commit 4de47e4
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -1357,13 +1357,13 @@ internal virtual HttpResponseMessage GetResponse(HttpClient client, HttpRequestM
if (string.Equals(RetryMode, "Exponential", StringComparison.OrdinalIgnoreCase))
{
// If RetryMode is specified as "Exponential", use the exponential backoff algorithm to determine the retry interval.
retryIntervalInSeconds = Math.Min(retryIntervalInSeconds * MathF.Pow(2, exponent), _maximumRetryIntervalInSeconds);
retryIntervalInSeconds = MathF.Min(retryIntervalInSeconds * MathF.Pow(2, exponent), _maximumRetryIntervalInSeconds);
}
else if (string.Equals(RetryMode, "ExponentialJitter", StringComparison.OrdinalIgnoreCase))
{
// If RetryMode is specified as "ExponentialJitter", use the exponential backoff with jitter algorithm to determine the retry interval.
Random random = new();
retryIntervalInSeconds = Math.Min(retryIntervalInSeconds * MathF.Pow(2, exponent) * random.NextDouble(), _maximumRetryIntervalInSeconds);
retryIntervalInSeconds = MathF.Min(retryIntervalInSeconds * MathF.Pow(2, exponent) * (float)random.NextDouble(), _maximumRetryIntervalInSeconds);
}

// If the status code is 429 get the retry interval from the Headers.
Expand Down

0 comments on commit 4de47e4

Please sign in to comment.