diff --git a/Snowflake.Data/Core/HttpUtil.cs b/Snowflake.Data/Core/HttpUtil.cs index 3e779e34a..f835b7eb5 100755 --- a/Snowflake.Data/Core/HttpUtil.cs +++ b/Snowflake.Data/Core/HttpUtil.cs @@ -523,8 +523,7 @@ protected override async Task SendAsync(HttpRequestMessage // No need to wait more than necessary if it can be avoided. // If the rest timeout will be reached before the next back-off, // then use the remaining connection timeout. - // Math.Max with 0 in case totalRetryTime > restTimeout.TotalSeconds - backOffInSec = Math.Max(Math.Min(backOffInSec, (int)restTimeout.TotalSeconds - totalRetryTime), 0); + backOffInSec = Math.Min(backOffInSec, (int)restTimeout.TotalSeconds - totalRetryTime + 1); } } }