Skip to content

Commit

Permalink
Rate-limited API request retries are canceled immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
soxtoby committed Sep 25, 2024
1 parent f0a2da7 commit 2cc2959
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SlackNet/SlackApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private async Task<T> WebApiRequest<T>(Func<HttpRequestMessage> createRequest, C
}
catch (SlackRateLimitException e) when (!DisableRetryOnRateLimit)
{
await Task.Delay(e.RetryAfter ?? TimeSpan.FromSeconds(1)).ConfigureAwait(false);
await Task.Delay(e.RetryAfter ?? TimeSpan.FromSeconds(1), cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
}
}
}
Expand Down

0 comments on commit 2cc2959

Please sign in to comment.