diff --git a/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/TransientFaultHandling/ExponentialBackoffRetryStrategy.cs b/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/TransientFaultHandling/ExponentialBackoffRetryStrategy.cs index cbe87e573cf61..b1241b6dcbe6c 100644 --- a/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/TransientFaultHandling/ExponentialBackoffRetryStrategy.cs +++ b/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/TransientFaultHandling/ExponentialBackoffRetryStrategy.cs @@ -112,10 +112,10 @@ public override ShouldRetryHandler GetShouldRetryHandler() { var random = new Random(); - var delta = (int) ((Math.Pow(2.0, currentRetryCount) - 1.0)* - random.Next((int) (_deltaBackoff.TotalMilliseconds*0.8), - (int) (_deltaBackoff.TotalMilliseconds*1.2))); - var interval = (int) Math.Min(checked(_minBackoff.TotalMilliseconds + delta), + var delta = (Math.Pow(2.0, currentRetryCount) - 1.0) * + random.Next((int) (_deltaBackoff.TotalMilliseconds*0.8), + (int) (_deltaBackoff.TotalMilliseconds*1.2)); + var interval = (int) Math.Min(_minBackoff.TotalMilliseconds + delta, _maxBackoff.TotalMilliseconds); TimeSpan retryInterval = TimeSpan.FromMilliseconds(interval);