Dont enter the ratelimit semaphore twice
This commit is contained in:
@@ -42,7 +42,7 @@ namespace Discord.Net.Queue
|
|||||||
}
|
}
|
||||||
catch (HttpRateLimitException ex)
|
catch (HttpRateLimitException ex)
|
||||||
{
|
{
|
||||||
//When a 429 occurs, we drop all our locks, including the ones we wanted.
|
//When a 429 occurs, we drop all our locks.
|
||||||
//This is generally safe though since 429s actually occuring should be very rare.
|
//This is generally safe though since 429s actually occuring should be very rare.
|
||||||
RequestQueueBucket bucket;
|
RequestQueueBucket bucket;
|
||||||
bool success = FindBucket(ex.BucketId, out bucket);
|
bool success = FindBucket(ex.BucketId, out bucket);
|
||||||
@@ -152,7 +152,8 @@ namespace Discord.Net.Queue
|
|||||||
if (millis <= 0 || !await _semaphore.WaitAsync(millis).ConfigureAwait(false))
|
if (millis <= 0 || !await _semaphore.WaitAsync(millis).ConfigureAwait(false))
|
||||||
throw new TimeoutException();
|
throw new TimeoutException();
|
||||||
}
|
}
|
||||||
await _semaphore.WaitAsync().ConfigureAwait(false);
|
else
|
||||||
|
await _semaphore.WaitAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
private async Task QueueExitAsync()
|
private async Task QueueExitAsync()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user