Handle disconnection errors more gracefully in background tasks

This commit is contained in:
Lonami Exo
2019-04-01 08:46:07 +02:00
parent 34a8140ff0
commit 3398bee77a
2 changed files with 13 additions and 6 deletions

View File

@@ -413,7 +413,8 @@ class TelegramBaseClient(abc.ABC):
their job with the client is complete and we should clean it up all.
"""
await self._sender.disconnect()
await helpers._cancel(self._log, updates_handle=self._updates_handle)
await helpers._cancel(self._log[__name__],
updates_handle=self._updates_handle)
async def _switch_dc(self, new_dc):
"""