Merge pull request #201 from apatrushev/fix-199

process cancellation in dispatch polling
This commit is contained in:
Alex Root Junior 2019-09-04 13:58:34 +03:00 committed by GitHub
commit 4984c2313a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -284,6 +284,8 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
try:
with self.bot.request_timeout(request_timeout):
updates = await self.bot.get_updates(limit=limit, offset=offset, timeout=timeout)
except asyncio.CancelledError:
break
except:
log.exception('Cause exception while getting updates.')
await asyncio.sleep(error_sleep)