Skip to content

The only downloader you need. 下载器的集大成者。

修复创建空线程的bug

AlphaQianc5247dc6d6eb
diff --git a/app/common/download_task.py b/app/common/download_task.py
index 5d207ff8..1ea65e77 100644
--- a/app/common/download_task.py
+++ b/app/common/download_task.py
@@ -57,6 +57,7 @@ class ParallelDownloadStrategy(WorkerStrategy):
"""Handle parallel download for a specific worker"""
if worker.isCompleted:
worker.progress = worker.endPos
+ return
finished = False
while not finished:
@@ -87,7 +88,7 @@ class ParallelDownloadStrategy(WorkerStrategy):
finished = True
except Exception as e:
- logger.info(f"Thread {worker.startPos}-{worker.endPos} is reconnecting, Error: {repr(e)}")
+ logger.info(f"Thread {worker.startPos}-{worker.endPos} is reconnecting, progress: {worker.progress}, Error: {repr(e)}")
await asyncio.sleep(5)
worker.progress = worker.endPos