diff --git a/binance/ws/depthcache.py b/binance/ws/depthcache.py index 5b5484a3f..ed6048e6e 100644 --- a/binance/ws/depthcache.py +++ b/binance/ws/depthcache.py @@ -188,15 +188,8 @@ async def __aexit__(self, *args, **kwargs): await self._socket.__aexit__(*args, **kwargs) async def recv(self): - dc = None - while not dc: - try: - res = await asyncio.wait_for(self._socket.recv(), timeout=self.TIMEOUT) - except Exception as e: - self._log.warning(e) - else: - dc = await self._depth_event(res) - return dc + res = await asyncio.wait_for(self._socket.recv(), timeout=self.TIMEOUT) + return await self._depth_event(res) async def _init_cache(self): """Initialise the depth cache calling REST endpoint