From d0acdfd77dab0e148ad14820b27588a07fc8409b Mon Sep 17 00:00:00 2001 From: R4ndomUsers Date: Thu, 23 Nov 2023 18:55:32 +0700 Subject: [PATCH] Forgot --- bot/__main__.py | 2 +- bot/helper/ext_utils/files_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/__main__.py b/bot/__main__.py index 03aa13bc37d..21e833c6f18 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -117,7 +117,7 @@ async def restart(_, message): if Interval: for intvl in list(Interval.values()): intvl.cancel() - await sync_to_async(clean_all) + await clean_all() proc1 = await create_subprocess_exec( "pkill", "-9", "-f", "gunicorn|aria2c|qbittorrent-nox|ffmpeg|rclone" ) diff --git a/bot/helper/ext_utils/files_utils.py b/bot/helper/ext_utils/files_utils.py index 9495cc130fe..dd40d0d9312 100644 --- a/bot/helper/ext_utils/files_utils.py +++ b/bot/helper/ext_utils/files_utils.py @@ -9,7 +9,7 @@ from .exceptions import NotSupportedExtractionArchive from bot import aria2, LOGGER, DOWNLOAD_DIR, get_client, GLOBAL_EXTENSION_FILTER -from bot.helper.ext_utils.bot_utils import sync_to_async, cmd_exec +from bot.helper.ext_utils.bot_utils import sync_to_async, async_to_sync, cmd_exec ARCH_EXT = [ ".tar.bz2", @@ -102,7 +102,7 @@ async def clean_all(): def exit_clean_up(signal, frame): try: LOGGER.info("Please wait, while we clean up and stop the running downloads") - clean_all() + async_to_sync(clean_all) srun(["pkill", "-9", "-f", "gunicorn|aria2c|qbittorrent-nox|ffmpeg"]) sexit(0) except KeyboardInterrupt: