Don't retry if remaining time isn't enough.
This commit is contained in:
Родитель
30a0551475
Коммит
e0d33e93d6
|
@ -49,12 +49,6 @@ namespace Microsoft.Azure.EventHubs
|
|||
TimeSpan retryAfter = this.minimumBackoff.Add(TimeSpan.FromMilliseconds(nextRetryIntervalSeconds * 1000 + nextRetryIntervalMilliseconds));
|
||||
retryAfter = retryAfter.Add(TimeSpan.FromSeconds(baseWaitTimeSecs));
|
||||
|
||||
// Don't retry if remaining time isn't enough.
|
||||
if (remainingTime.TotalSeconds < Math.Max(retryAfter.TotalSeconds, ClientConstants.TimerToleranceInSeconds))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return retryAfter;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,16 @@ namespace Microsoft.Azure.EventHubs
|
|||
}
|
||||
}
|
||||
|
||||
return this.OnGetNextRetryInterval(clientId, lastException, remainingTime, baseWaitTime);
|
||||
var retryAfter = this.OnGetNextRetryInterval(clientId, lastException, remainingTime, baseWaitTime);
|
||||
|
||||
// Don't retry if remaining time isn't enough.
|
||||
if (retryAfter == null ||
|
||||
remainingTime.TotalSeconds < Math.Max(retryAfter.Value.TotalSeconds, ClientConstants.TimerToleranceInSeconds))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return retryAfter;
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче