fix: workaround for receiving danmu messages continuously timed out

This commit is contained in:
acgnhik 2022-11-06 10:59:58 +08:00
parent 8ad8d53a34
commit 2ad6847f42

View File

@ -267,6 +267,9 @@ class DanmakuClient(EventEmitter[DanmakuListener], AsyncStoppableMixin):
while True:
try:
wsmsg = await self._ws.receive(timeout=self._HEARTBEAT_INTERVAL)
except asyncio.TimeoutError as e:
logger.debug(f'Failed to receive message due to: {repr(e)}')
continue
except Exception as e:
await self._handle_error(e)
else: