From b5c398945198a641dd964b6d207a39981d2b3848 Mon Sep 17 00:00:00 2001 From: lzzy12 Date: Fri, 11 Oct 2019 23:28:46 +0530 Subject: [PATCH] exit_cleanup: Use aria2.remove_all method instead of loop Signed-off-by: lzzy12 --- bot/helper/ext_utils/fs_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/helper/ext_utils/fs_utils.py b/bot/helper/ext_utils/fs_utils.py index 4a81466..ad3b40f 100644 --- a/bot/helper/ext_utils/fs_utils.py +++ b/bot/helper/ext_utils/fs_utils.py @@ -22,8 +22,7 @@ def start_cleanup(): def exit_clean_up(signal, frame): try: LOGGER.info("Please wait, while we clean up the downloads and stop running downloads") - for download in aria2.get_downloads(): - download.remove() + aria2.remove_all(True) shutil.rmtree(DOWNLOAD_DIR) sys.exit(0) except KeyboardInterrupt: