close web-session on app close

This commit is contained in:
Oleg A 2024-08-06 12:04:26 +03:00
parent 3ba724e2fa
commit a7711cc2e0
No known key found for this signature in database
GPG key ID: 5FE046817A9657C5
9 changed files with 37 additions and 2 deletions

View file

@ -52,6 +52,9 @@ async def main() -> None:
# And the run events dispatching
await dp.start_polling(bot)
# Don't forget to close web-session on your app close
await bot.session.close()
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, stream=sys.stdout)