Handle GapError in updates loop

This commit is contained in:
Lonami Exo 2022-02-24 11:52:39 +01:00
parent 4c94407b79
commit 392808b950

View File

@ -201,7 +201,11 @@ async def _update_loop(self: 'TelegramClient'):
continue
processed = []
users, chats = self._message_box.process_updates(updates, self._entity_cache, processed)
try:
users, chats = self._message_box.process_updates(updates, self._entity_cache, processed)
except GapError:
continue # get(_channel)_difference will start returning requests
updates_to_dispatch.extend(_preprocess_updates(self, processed, users, chats))
except Exception:
self._log[__name__].exception('Fatal error handling updates (this is a bug in Telethon, please report it)')