From 660a6ba913c8a3c0c6cb7a8724ff322f6763527e Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 25 Jul 2020 12:21:08 +0800 Subject: [PATCH] Update qbittorrent_worker.py --- plugins/qbittorrent/workers/qbittorrent_worker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/qbittorrent/workers/qbittorrent_worker.py b/plugins/qbittorrent/workers/qbittorrent_worker.py index 887811bde..75d4b9a5e 100755 --- a/plugins/qbittorrent/workers/qbittorrent_worker.py +++ b/plugins/qbittorrent/workers/qbittorrent_worker.py @@ -128,6 +128,7 @@ class downloadBT(Thread): has_suffix.append('.' + _has_suffix[x]) has_suffix.append('.' + _has_suffix[x].upper()) self.has_suffix = has_suffix + self.__conn() def __conn(self): try: @@ -139,6 +140,7 @@ class downloadBT(Thread): return True except Exception as e: self.__db_err = e + os.exit('未连接数据库!') return False def __close(self): @@ -617,6 +619,7 @@ class downloadBT(Thread): def check_task(self): while True: + self.__conn() torrents = self.qb.torrents(filter='downloading') tlen = len(torrents) if tlen > 0: @@ -639,6 +642,7 @@ class downloadBT(Thread): def completed(self): while True: + self.__conn() torrents = self.qb.torrents(filter='completed') if not torrents: continue