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...')
|
self._log.debug('Closing current connection...')
|
||||||
await self._connection.disconnect()
|
await self._connection.disconnect()
|
||||||
finally:
|
finally:
|
||||||
self._connection = None
|
|
||||||
self._log.debug('Cancelling %d pending message(s)...', len(self._pending_state))
|
self._log.debug('Cancelling %d pending message(s)...', len(self._pending_state))
|
||||||
for state in self._pending_state.values():
|
for state in self._pending_state.values():
|
||||||
if error and not state.future.done():
|
if error and not state.future.done():
|
||||||
@ -274,6 +273,8 @@ class MTProtoSender:
|
|||||||
)
|
)
|
||||||
|
|
||||||
self._log.info('Disconnection from %s complete!', self._connection)
|
self._log.info('Disconnection from %s complete!', self._connection)
|
||||||
|
self._connection = None
|
||||||
|
|
||||||
if self._disconnected and not self._disconnected.done():
|
if self._disconnected and not self._disconnected.done():
|
||||||
if error:
|
if error:
|
||||||
self._disconnected.set_exception(error)
|
self._disconnected.set_exception(error)
|
||||||
|
Loading…
Reference in New Issue
Block a user