mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 18:46:40 +00: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():
|
while self.is_connected():
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(
|
await asyncio.wait_for(
|
||||||
asyncio.shield(self.disconnected, loop=self._loop),
|
self.disconnected, timeout=60, loop=self._loop
|
||||||
timeout=60,
|
|
||||||
loop=self._loop
|
|
||||||
)
|
)
|
||||||
continue # We actually just want to act upon timeout
|
continue # We actually just want to act upon timeout
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
@ -214,7 +214,7 @@ class MTProtoSender:
|
|||||||
ends, either by user action or in the background.
|
ends, either by user action or in the background.
|
||||||
"""
|
"""
|
||||||
if self._disconnected is not None:
|
if self._disconnected is not None:
|
||||||
return self._disconnected
|
return asyncio.shield(self._disconnected, loop=self._loop)
|
||||||
else:
|
else:
|
||||||
raise ConnectionError('Sender was never connected')
|
raise ConnectionError('Sender was never connected')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user