mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 16:06:15 +00:00
Fixed unhandled exception when websocket connection is interupted while waiting for ratelimit
This commit is contained in:
parent
6a105c6f8f
commit
9ff673d8be
@ -461,6 +461,8 @@ namespace CryptoExchange.Net.Sockets
|
||||
while (_sendBuffer.TryDequeue(out var data))
|
||||
{
|
||||
if (Parameters.RateLimiter != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var limitResult = await Parameters.RateLimiter.ProcessAsync(_logger, data.Id, RateLimitItemType.Request, requestDefinition, _baseAddress, null, data.Weight, Parameters.RateLimitingBehaviour, _ctsSource.Token).ConfigureAwait(false);
|
||||
if (!limitResult)
|
||||
@ -469,6 +471,12 @@ namespace CryptoExchange.Net.Sockets
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// canceled
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user