mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 04:43:45 +03:00
Do not cancel UpdatesThread .receive() on reconnection
This commit is contained in:
parent
a73be04da7
commit
5c138977c3
|
@ -785,7 +785,10 @@ class TelegramClient(TelegramBareClient):
|
||||||
try:
|
try:
|
||||||
self._updates_thread_receiving.set()
|
self._updates_thread_receiving.set()
|
||||||
self._logger.debug('Trying to receive updates from the updates thread')
|
self._logger.debug('Trying to receive updates from the updates thread')
|
||||||
|
|
||||||
result = self.sender.receive_update(timeout=timeout)
|
result = self.sender.receive_update(timeout=timeout)
|
||||||
|
|
||||||
|
self._updates_thread_receiving.clear()
|
||||||
self._logger.info('Received update from the updates thread')
|
self._logger.info('Received update from the updates thread')
|
||||||
for handler in self._update_handlers:
|
for handler in self._update_handlers:
|
||||||
handler(result)
|
handler(result)
|
||||||
|
@ -812,7 +815,6 @@ class TelegramClient(TelegramBareClient):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
self._logger.debug('Updates thread released the lock')
|
self._logger.debug('Updates thread released the lock')
|
||||||
self._updates_thread_receiving.clear()
|
|
||||||
|
|
||||||
# Thread is over, so clean unset its variable
|
# Thread is over, so clean unset its variable
|
||||||
self._updates_thread = None
|
self._updates_thread = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user