From 2cc2959ec6dcab36974d1e21744ee2efee481131 Mon Sep 17 00:00:00 2001 From: Simon Oxtoby Date: Wed, 25 Sep 2024 12:35:03 +1000 Subject: [PATCH] Rate-limited API request retries are canceled immediately --- SlackNet/SlackApiClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SlackNet/SlackApiClient.cs b/SlackNet/SlackApiClient.cs index c9a644b..60c4c50 100644 --- a/SlackNet/SlackApiClient.cs +++ b/SlackNet/SlackApiClient.cs @@ -246,7 +246,7 @@ private async Task WebApiRequest(Func 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); } } }