mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-23 19:26:57 -04:00
Fix nullref in HTTP retry policy
This commit is contained in:
parent
56df93305e
commit
91ba79e6ec
1 changed files with 3 additions and 2 deletions
|
@ -39,8 +39,9 @@ public static class Http
|
||||||
8,
|
8,
|
||||||
(i, result, _) =>
|
(i, result, _) =>
|
||||||
{
|
{
|
||||||
// If rate-limited, use retry-after header as the guide
|
// If rate-limited, use retry-after header as the guide.
|
||||||
if (result.Result.Headers.RetryAfter?.Delta is { } retryAfter)
|
// The response can be null here if an exception was thrown.
|
||||||
|
if (result.Result?.Headers.RetryAfter?.Delta is { } retryAfter)
|
||||||
{
|
{
|
||||||
// Add some buffer just in case
|
// Add some buffer just in case
|
||||||
return retryAfter + TimeSpan.FromSeconds(1);
|
return retryAfter + TimeSpan.FromSeconds(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue