mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 11:06:39 +00:00
Fix logging bug on disconnect
This commit is contained in:
parent
c0e4d6c8b6
commit
f5de2cd9a0
@ -258,7 +258,6 @@ class MTProtoSender:
|
||||
self._log.debug('Closing current connection...')
|
||||
await self._connection.disconnect()
|
||||
finally:
|
||||
self._connection = None
|
||||
self._log.debug('Cancelling %d pending message(s)...', len(self._pending_state))
|
||||
for state in self._pending_state.values():
|
||||
if error and not state.future.done():
|
||||
@ -274,6 +273,8 @@ class MTProtoSender:
|
||||
)
|
||||
|
||||
self._log.info('Disconnection from %s complete!', self._connection)
|
||||
self._connection = None
|
||||
|
||||
if self._disconnected and not self._disconnected.done():
|
||||
if error:
|
||||
self._disconnected.set_exception(error)
|
||||
|
Loading…
Reference in New Issue
Block a user