From 0d65ae6ea13a3fb2e2fd766b98f5aab52bc456a5 Mon Sep 17 00:00:00 2001 From: David Brazda Date: Fri, 23 Feb 2024 10:30:12 +0700 Subject: [PATCH] #136 bugfix properly closing ws --- v2realbot/loader/trade_ws_streamer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v2realbot/loader/trade_ws_streamer.py b/v2realbot/loader/trade_ws_streamer.py index bdf4629..961a585 100644 --- a/v2realbot/loader/trade_ws_streamer.py +++ b/v2realbot/loader/trade_ws_streamer.py @@ -59,7 +59,12 @@ class Trade_WS_Streamer(Thread): #if it is the last item at all, stop the client from running if len(Trade_WS_Streamer._streams) == 0: print("removed last item from WS, stopping the client") - Trade_WS_Streamer.client.stop() + #Trade_WS_Streamer.client.stop_ws() + #Trade_WS_Streamer.client.stop() + #zkusíme explicitně zavolat kroky pro disconnect od ws + if Trade_WS_Streamer.client._stop_stream_queue.empty(): + Trade_WS_Streamer.client._stop_stream_queue.put_nowait({"should_stop": True}) + Trade_WS_Streamer.client._should_run = False return if not self.symbol_exists(obj.symbol):