update catch block in cancel channel tasks

This commit is contained in:
Timothy Pogue 2022-11-22 12:43:45 -07:00
parent a5442772fc
commit 48242ca02b

View File

@ -99,7 +99,7 @@ class WebSocketChannel:
self._calc_send_limit() self._calc_send_limit()
except asyncio.TimeoutError: except asyncio.TimeoutError:
logger.info(f"Connection for {self} is too far behind, disconnecting") logger.info(f"Connection for {self} timed out, disconnecting")
raise raise
# Without this sleep, messages would send to one channel # Without this sleep, messages would send to one channel
@ -138,7 +138,7 @@ class WebSocketChannel:
try: try:
await self._websocket.close() await self._websocket.close()
except Exception: except RuntimeError:
pass pass
def is_closed(self) -> bool: def is_closed(self) -> bool:
@ -196,8 +196,10 @@ class WebSocketChannel:
await task await task
except ( except (
asyncio.CancelledError, asyncio.CancelledError,
asyncio.TimeoutError,
WebSocketDisconnect, WebSocketDisconnect,
ConnectionClosed ConnectionClosed,
RuntimeError
): ):
pass pass
except Exception as e: except Exception as e: