From 5c045e9708d6377420002453aa038b8f4e06b95b Mon Sep 17 00:00:00 2001 From: Ika Bar-Menachem Date: Thu, 21 Feb 2019 21:14:05 +0200 Subject: [PATCH] Fixed bug where retryAfter header returned value in seconds but the delay was in milliseconds. (#5268) --- .../ClientRuntime/ClientRuntime/RetryAfterDelegatingHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SdkCommon/ClientRuntime/ClientRuntime/RetryAfterDelegatingHandler.cs b/src/SdkCommon/ClientRuntime/ClientRuntime/RetryAfterDelegatingHandler.cs index e0902fc633baf..4ee499b734da0 100644 --- a/src/SdkCommon/ClientRuntime/ClientRuntime/RetryAfterDelegatingHandler.cs +++ b/src/SdkCommon/ClientRuntime/ClientRuntime/RetryAfterDelegatingHandler.cs @@ -3,6 +3,7 @@ namespace Microsoft.Rest { + using System; using System.Globalization; using System.Linq; using System.Net; @@ -58,7 +59,7 @@ protected override async Task SendAsync(HttpRequestMessage var retryAfter = int.Parse(retryValue, CultureInfo.InvariantCulture); // wait for that duration - await Task.Delay(retryAfter,cancellationToken); + await Task.Delay(TimeSpan.FromSeconds(retryAfter), cancellationToken); // and try again continue;