Make disconnect synchronous

This also fixes a bug when auto-reconnecting in MTProtoSender.
This commit is contained in:
Lonami Exo
2018-10-16 11:56:17 +02:00
parent 477fbd8dc7
commit 9cbc088b76
6 changed files with 28 additions and 34 deletions

View File

@@ -268,7 +268,7 @@ class DownloadMethods(UserMethods):
if exported:
await self._return_exported_sender(sender)
elif sender != self._sender:
await sender.disconnect()
sender.disconnect()
if isinstance(file, str) or in_memory:
f.close()