mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-03 19:00:21 +03:00
Handle cancellation on the receive loop
This commit is contained in:
parent
e319fa3aa9
commit
37b9922f64
|
@ -113,6 +113,8 @@ class Connection(abc.ABC):
|
||||||
while not self._disconnected.is_set():
|
while not self._disconnected.is_set():
|
||||||
data = await self._recv()
|
data = await self._recv()
|
||||||
await self._recv_queue.put((True, data))
|
await self._recv_queue.put((True, data))
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
await self._recv_queue.put((False, e))
|
await self._recv_queue.put((False, e))
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user