Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouthwatering777 committed Feb 18, 2022
1 parent fbc4554 commit 15682d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## 1.36.0.dev (development stage/unreleased/unstable)
### Fixed
- UnboundLocalError: local variable 'error_msg' referenced before assignment in sockets.py line 209 reported in [issue#235](https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/235)
- Avoid error 2 of this post: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/131#issuecomment-1042747365

## 1.36.0
### Changed
Expand Down
9 changes: 7 additions & 2 deletions unicorn_binance_websocket_api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,7 @@ def _create_stream_thread(self,
self.stop_manager_with_all_streams()
sys.exit(1)
logger.critical(f"BinanceWebSocketApiManager._create_stream_thread() stream_id={str(stream_id)} "
f"error: 7 - {str(error_msg)} - if this stream did not restart after this error, please "
f"create an issue: "
f" - RuntimeError `error: 7` - error_msg: - {str(error_msg)} - Please create an issue: "
f"https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/new/choose")
loop.close()
finally:
Expand Down Expand Up @@ -711,6 +710,9 @@ def _restart_stream(self, stream_id):
self.stream_list[stream_id]['stream_buffer_maxlen'],
True))
thread.start()
# Sleep to avoid error 2 of this post:
# https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/131#issuecomment-1042747365
time.sleep(0.3)
return stream_id

def _restart_stream_thread(self, stream_id):
Expand Down Expand Up @@ -1213,6 +1215,9 @@ def create_stream(self,
stream_buffer_maxlen,
False))
thread.start()
# Sleep to avoid error 2 of this post:
# https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api/issues/131#issuecomment-1042747365
time.sleep(0.3)
return stream_id

def create_websocket_uri(self, channels, markets, stream_id=False, api_key=False, api_secret=False, symbols=False):
Expand Down

0 comments on commit 15682d2

Please sign in to comment.