Shield self.disconnected and log RpcCallFail

This commit is contained in:
Lonami Exo
2018-06-18 14:27:40 +02:00
parent ee7a44d447
commit efc48ee3b0
2 changed files with 11 additions and 4 deletions

View File

@@ -177,7 +177,11 @@ class UpdateMethods(UserMethods):
rnd = lambda: random.randrange(-2**63, 2**63)
while self.is_connected():
try:
await asyncio.wait_for(self.disconnected, timeout=60)
await asyncio.wait_for(
asyncio.shield(self.disconnected, loop=self._loop),
timeout=60,
loop=self._loop
)
continue # We actually just want to act upon timeout
except asyncio.TimeoutError:
pass