add app close

This commit is contained in:
Dmitry Afanasyev 2022-08-16 23:50:33 +03:00
parent fff8042242
commit 1c67c28ca3
2 changed files with 9 additions and 0 deletions

View File

@ -25,3 +25,11 @@ killall python
## Help article
[Пишем асинхронного Телеграм-бота](https://habr.com/ru/company/kts/blog/598575/)
[fast_api_aiogram](https://programtalk.com/vs4/python/daya0576/he-weather-bot/telegram_bot/dependencies.py/)
## TODO
- [ ] Добавить очередь сообщений
- [ ] Исправить запуск локально
- [ ] Добавить тестов

View File

@ -32,6 +32,7 @@ async def bot_shutdown() -> None:
# Close DB connection (if used)
await dispatcher.storage.close()
await dispatcher.storage.wait_closed()
app.close()
logger.warning('Bye!')