mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-16 19:41:07 +03:00
Shield disconnected Future in the MTProtoSender instead
This commit is contained in:
parent
efc48ee3b0
commit
51d8ea0fa8
|
@ -178,9 +178,7 @@ class UpdateMethods(UserMethods):
|
|||
while self.is_connected():
|
||||
try:
|
||||
await asyncio.wait_for(
|
||||
asyncio.shield(self.disconnected, loop=self._loop),
|
||||
timeout=60,
|
||||
loop=self._loop
|
||||
self.disconnected, timeout=60, loop=self._loop
|
||||
)
|
||||
continue # We actually just want to act upon timeout
|
||||
except asyncio.TimeoutError:
|
||||
|
|
|
@ -214,7 +214,7 @@ class MTProtoSender:
|
|||
ends, either by user action or in the background.
|
||||
"""
|
||||
if self._disconnected is not None:
|
||||
return self._disconnected
|
||||
return asyncio.shield(self._disconnected, loop=self._loop)
|
||||
else:
|
||||
raise ConnectionError('Sender was never connected')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user