More graceful stopping of long polling.

This commit is contained in:
Alex Root Junior 2018-01-06 14:31:59 +02:00
parent 62d5dda84d
commit 16a61b092f
3 changed files with 39 additions and 20 deletions

View file

@ -34,6 +34,7 @@ async def _shutdown(dispatcher: Dispatcher, callback=None):
if dispatcher.is_polling():
dispatcher.stop_polling()
await dispatcher.wait_closed()
await dispatcher.storage.close()
await dispatcher.storage.wait_closed()