diff --git a/pyhilo/websocket.py b/pyhilo/websocket.py index 17a406f..d18525c 100644 --- a/pyhilo/websocket.py +++ b/pyhilo/websocket.py @@ -298,7 +298,7 @@ async def _clean_queue(self) -> None: async def async_disconnect(self) -> None: """Disconnect from the websocket server.""" - await self._clean_queue() + self._clean_queue() if not self.connected: return @@ -319,12 +319,11 @@ async def async_listen(self) -> None: except ConnectionClosedError as err: LOG.error(f"Websocket: Closed while listening: {err}") LOG.exception(err) - await self._clean_queue() pass finally: LOG.info("Websocket: Listen completed; cleaning up") self._watchdog.cancel() - await self._clean_queue() + self._clean_queue() for callback in self._disconnect_callbacks: schedule_callback(callback)