From 2602fe768960f362beaa5df18aa840da52dc974a Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Mon, 9 Jan 2023 08:28:21 +0700 Subject: [PATCH] Update __main__.py --- misskaty/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misskaty/__main__.py b/misskaty/__main__.py index a3decdc2..878a8b94 100644 --- a/misskaty/__main__.py +++ b/misskaty/__main__.py @@ -338,6 +338,9 @@ General command are: return await client.answer_callback_query(query.id) +async def cleanup(): + await app.stop() + await user.stop() if __name__ == "__main__": try: @@ -347,5 +350,6 @@ if __name__ == "__main__": except Exception as err: LOGGER.error(err.with_traceback(None)) finally: + loop.run_until_complete(cleanup()) loop.stop() print("------------------------ Stopped Services ------------------------")