From 97545e3876301f72c83a5efff077c54d43c54ddd Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Tue, 5 Apr 2016 10:12:03 -0700 Subject: [PATCH] fixes issue #890 --- .../ExponentialBackoffRetryStrategy.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);