process cancellation in dispatch polling

This commit is contained in:
Anton Patrushev 2019-08-28 23:39:31 +02:00
parent 58a8f43e2c
commit a4f684f6bf

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)