Skip to content

Commit

Permalink
possible solution [issue#131](LUCIT-Systems-and-Development/unicorn-b…
Browse files Browse the repository at this point in the history
  • Loading branch information
john committed Mar 7, 2022
1 parent b0a832b commit b0aeba2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion unicorn_binance_websocket_api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ def create_stream(self,
logger.debug(f"BinanceWebSocketApiManager.create_stream({str(channels)}, {str(markets_new)}, "
f"{str(stream_label)}, {str(stream_buffer_name)}, {str(symbols)}), {stream_buffer_maxlen} "
f"with stream_id={str(stream_id)} - Waiting till new thread is started")
time.sleep(1)
time.sleep(0.1)
return stream_id

def create_websocket_uri(self, channels, markets, stream_id=False, api_key=False, api_secret=False, symbols=False):
Expand Down
2 changes: 1 addition & 1 deletion unicorn_binance_websocket_api/sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def __init__(self, manager, stream_id, channels, markets):
async def start_socket(self):
logger.info(f"BinanceWebSocketApiSocket.start_socket({str(self.stream_id)}, {str(self.channels)}, "
f"{str(self.markets)}) socket_id={str(self.socket_id)} recent_socket_id={str(self.socket_id)}")
self.manager.stream_thread_started[self.stream_id] = True
try:
async with BinanceWebSocketApiConnection(self.manager,
self.stream_id,
self.socket_id,
self.channels,
self.markets,
symbols=self.symbols) as websocket:
self.manager.stream_thread_started[self.stream_id] = True
while True:
if self.manager.is_stop_request(self.stream_id):
self.manager.stream_is_stopping(self.stream_id)
Expand Down

0 comments on commit b0aeba2

Please sign in to comment.