Clean qbtask

This commit is contained in:
FA Tulloh 2021-08-11 06:00:40 +08:00 committed by GitHub
parent acf45cd4ae
commit 3801f4b283
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import requests
from telegram.ext import CommandHandler from telegram.ext import CommandHandler
from telegram import InlineKeyboardMarkup from telegram import InlineKeyboardMarkup
from bot import Interval, INDEX_URL, BUTTON_FOUR_NAME, BUTTON_FOUR_URL, BUTTON_FIVE_NAME, BUTTON_FIVE_URL, BUTTON_SIX_NAME, BUTTON_SIX_URL, BLOCK_MEGA_FOLDER, BLOCK_MEGA_LINKS, VIEW_LINK, aria2 from bot import Interval, INDEX_URL, BUTTON_FOUR_NAME, BUTTON_FOUR_URL, BUTTON_FIVE_NAME, BUTTON_FIVE_URL, BUTTON_SIX_NAME, BUTTON_SIX_URL, BLOCK_MEGA_FOLDER, BLOCK_MEGA_LINKS, VIEW_LINK, aria2, get_client
from bot import dispatcher, DOWNLOAD_DIR, download_dict, download_dict_lock, SHORTENER, SHORTENER_API, TAR_UNZIP_LIMIT from bot import dispatcher, DOWNLOAD_DIR, download_dict, download_dict_lock, SHORTENER, SHORTENER_API, TAR_UNZIP_LIMIT
from bot.helper.ext_utils import fs_utils, bot_utils from bot.helper.ext_utils import fs_utils, bot_utils
from bot.helper.ext_utils.bot_utils import get_mega_link_type from bot.helper.ext_utils.bot_utils import get_mega_link_type
@ -52,6 +52,7 @@ class MirrorListener(listeners.MirrorListeners):
def clean(self): def clean(self):
try: try:
aria2.purge() aria2.purge()
get_client().torrents_delete(torrent_hashes="all", delete_files=True)
Interval[0].cancel() Interval[0].cancel()
del Interval[0] del Interval[0]
delete_all_messages() delete_all_messages()