1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 16:32:57 +00:00

Fixed timing issue in SymbolOrderBook stopping

This commit is contained in:
Jkorf
2026-05-26 09:27:04 +02:00
parent 6b575be1ac
commit f176fb5db5
@@ -333,17 +333,19 @@ namespace CryptoExchange.Net.OrderBook
{ {
_logger.OrderBookStopping(Api, Symbol); _logger.OrderBookStopping(Api, Symbol);
_cts?.Cancel(); _cts?.Cancel();
_queueEvent.Set();
if (_processTask != null)
await _processTask.ConfigureAwait(false);
if (_subscription != null) { if (_subscription != null)
{
await _subscription.CloseAsync().ConfigureAwait(false); await _subscription.CloseAsync().ConfigureAwait(false);
_subscription.ConnectionLost -= HandleConnectionLost; _subscription.ConnectionLost -= HandleConnectionLost;
_subscription.ConnectionClosed -= HandleConnectionClosed; _subscription.ConnectionClosed -= HandleConnectionClosed;
_subscription.ConnectionRestored -= HandleConnectionRestored; _subscription.ConnectionRestored -= HandleConnectionRestored;
} }
_queueEvent.Set();
if (_processTask != null)
await _processTask.ConfigureAwait(false);
Status = OrderBookStatus.Disconnected; Status = OrderBookStatus.Disconnected;
_logger.OrderBookStopped(Api, Symbol); _logger.OrderBookStopped(Api, Symbol);
} }