Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 37bcedb

Browse files
committed
Fixed on_open bug.
1 parent 88510c8 commit 37bcedb

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

bittrex_websocket/websocket_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def _start_main_thread(self):
217217
The websocket clients starts a separate thread upon
218218
initialization with further subthreads for each connection.
219219
"""
220+
self.on_open()
220221
thread = Thread(target=self._start_socket_control_queue)
221222
thread.daemon = True
222223
self.threads[thread.getName()] = thread
@@ -538,7 +539,6 @@ def _handle_reconnect(self, reconnect_event):
538539
def _is_first_run(self, tickers, sub_type):
539540
# Check if the websocket has been initiated already or if it's the first run.
540541
if not self.tickers.list:
541-
self.on_open()
542542
self._subscribe_first_run(tickers, sub_type)
543543
else:
544544
return False
@@ -559,7 +559,6 @@ def _handle_is_first_run(self, is_first_run_event):
559559
tickers, sub_type = is_first_run_event.tickers, is_first_run_event.sub_type
560560
sub_states = self.tickers.sort_by_sub_state()
561561
if not sub_states:
562-
self.on_open()
563562
self._subscribe_first_run(tickers, sub_type)
564563
elif len(sub_states) == 1 and False in sub_states:
565564
self._subscribe_first_run(tickers, sub_type)

0 commit comments

Comments
 (0)