_wait_node_finish 传入的是 TaskNode 但字段在 ChatDownloadConfig 上, 导致 AttributeError 使协程崩溃,第二个任务永远无法启动。 改为传入 ChatDownloadConfig 对象。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -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()
|
||||
# 所有频道都已在循环内快照并重置,此处仅确保最终状态干净
|
||||
|
||||
Reference in New Issue
Block a user