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:
@@ -333,17 +333,19 @@ namespace CryptoExchange.Net.OrderBook
|
||||
{
|
||||
_logger.OrderBookStopping(Api, Symbol);
|
||||
_cts?.Cancel();
|
||||
_queueEvent.Set();
|
||||
if (_processTask != null)
|
||||
await _processTask.ConfigureAwait(false);
|
||||
|
||||
if (_subscription != null) {
|
||||
if (_subscription != null)
|
||||
{
|
||||
await _subscription.CloseAsync().ConfigureAwait(false);
|
||||
_subscription.ConnectionLost -= HandleConnectionLost;
|
||||
_subscription.ConnectionClosed -= HandleConnectionClosed;
|
||||
_subscription.ConnectionRestored -= HandleConnectionRestored;
|
||||
}
|
||||
|
||||
_queueEvent.Set();
|
||||
if (_processTask != null)
|
||||
await _processTask.ConfigureAwait(false);
|
||||
|
||||
Status = OrderBookStatus.Disconnected;
|
||||
_logger.OrderBookStopped(Api, Symbol);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user