Skip to content
Merged
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: 2 additions & 3 deletions binance/ws/reconnecting_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,15 @@ async def close(self):

async def __aexit__(self, exc_type, exc_val, exc_tb):
self._log.debug(f"Closing Websocket {self._url}{self._prefix}{self._path}")
if self._handle_read_loop:
await self._kill_read_loop()
if self._exit_coro:
await self._exit_coro(self._path)
self.ws_state = WSListenerState.EXITING
if self.ws:
await self.ws.close()
if self._conn and hasattr(self._conn, "protocol"):
await self._conn.__aexit__(exc_type, exc_val, exc_tb)
self.ws = None
if self._handle_read_loop:
await self._kill_read_loop()

async def connect(self):
self._log.debug("Establishing new WebSocket connection")
Expand Down
Loading