From 8433c4cc4aa26bacccf51e39b411cde7bea79e3e Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Thu, 1 Mar 2018 19:39:52 +0200 Subject: [PATCH] Auto close bot HTTP-connections. --- aiogram/utils/executor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aiogram/utils/executor.py b/aiogram/utils/executor.py index ed8947eb..686bc7ea 100644 --- a/aiogram/utils/executor.py +++ b/aiogram/utils/executor.py @@ -39,6 +39,8 @@ async def _shutdown(dispatcher: Dispatcher, callback=None): await dispatcher.storage.close() await dispatcher.storage.wait_closed() + await dispatcher.bot.close() + async def _wh_shutdown(app): callback = app.get('_shutdown_callback', None)