From e40b15da332a4374b9541338da0e8b6ce15ab076 Mon Sep 17 00:00:00 2001 From: yuming Date: Thu, 30 Apr 2026 09:39:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=98=9F=E5=88=97=E7=AC=AC=E4=BA=8C=E4=B8=AA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _wait_node_finish 传入的是 TaskNode 但字段在 ChatDownloadConfig 上, 导致 AttributeError 使协程崩溃,第二个任务永远无法启动。 改为传入 ChatDownloadConfig 对象。 Co-Authored-By: Claude Sonnet 4.6 --- media_downloader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/media_downloader.py b/media_downloader.py index 9bd874b..d56712e 100644 --- a/media_downloader.py +++ b/media_downloader.py @@ -705,10 +705,10 @@ async def download_chat_task( update_task_progress(estimated_total=actual_total, is_checking=False) -async def _wait_node_finish(node: TaskNode): +async def _wait_node_finish(chat_config): """等待单个频道的所有下载任务完成(含重试中的任务)""" while True: - if node.need_check and node.finish_task >= node.total_task: + if chat_config.need_check and chat_config.finish_task >= chat_config.total_task: break await asyncio.sleep(0.5) @@ -725,7 +725,7 @@ async def download_all_chat(client: pyrogram.Client): finally: value.need_check = True # 等当前频道所有下载任务跑完,再拍快照;否则 completed_files 还是 0 - await _wait_node_finish(value.node) + await _wait_node_finish(value) snapshot_current_chat() reset_task_progress() # 所有频道都已在循环内快照并重置,此处仅确保最终状态干净