Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SmartApi/smartWebSocketV2.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ def close_connection(self):

def _on_error(self, wsapp, error):
self.RESUBSCRIBE_FLAG = True

# Don't reconnect if DISCONNECT_FLAG is True
if self.DISCONNECT_FLAG:
return False

if self.current_retry_attempt < self.MAX_RETRY_ATTEMPT:
logger.warning(f"Attempting to resubscribe/reconnect (Attempt {self.current_retry_attempt + 1})...")
self.current_retry_attempt += 1
Expand Down