Files
MemRelay/projects/46777563-9cef-472c-b0c8-31ee36f2ea1c/Checkpoint 2026-10-24 23-20-59 UTC [b30f07699e].md
T
memrelay 73940ef1e8 create: Checkpoint 2026-10-24 23:20:59 UTC [b30f07699e]
MemRelay-Operation: checkpoint-save:c2-engine-2026-10-25-handoff
MemRelay-Resource: a397a48b-8956-4a77-a093-de70fc37dc8f
2026-10-25 07:21:02 +08:00

36 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Checkpoint 2026-10-24 23:20:59 UTC [b30f07699e]
type: checkpoint
permalink: main/projects/46777563-9cef-472c-b0c8-31ee36f2ea1c/checkpoint-2026-10-24-23-20-59-utc-b30f07699e
stable_id: a397a48b-8956-4a77-a093-de70fc37dc8f
scope: project
memory_type: checkpoint
project_id: 46777563-9cef-472c-b0c8-31ee36f2ea1c
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 1
request_id: c2-engine-2026-10-25-handoff
created_at: '2026-10-24T23:20:59.647197+00:00'
updated_at: '2026-10-24T23:20:59.647197+00:00'
tags:
- handoff
- c2-engine
---
C2 调度与读编号已在 worktree E:\\code\\NqiTools\\Temp\\worktrees\\engine、分支 fix/engine 完成。基点 6b84a5e。没有推送,没有改 git config。
提交:
- 66148ec85c634a436f117a04c44f21a4e8de3a0c fix: 分块读取失败时重试,超时或结果过大就继续拆开
- 5e898038c626bba87782f6ffff669e6d703524cd feat: 把去重后的全市栅格编号写入 ids.spool
- 6db854131bab7ba4db416f5351445c44efe195a7 fix: 按当前登录调度下载,失效则暂停、批量落盘并改为轮询任务数
- ae7bf747db731eb82eb30dce857df168dc3eed32 test: 覆盖分块重试、登录失效暂停和全市编号续读
验证:在 worktree backend 用主仓库 backend\\.venv\\Scripts\\python.exe。import app 指向 worktree。pytest -q -p no:cacheprovider 为 44 passed。
实现要点:run_download 不再接收客户端,每次请求 state.get_client()。NqiAuthError 不计失败,走 on_session_expired,同一个任务协程等待后继续。分块最多重试 3 次,等待 1、3、9 秒;超时且仍可拆时立刻一分为四。GRID20 起始 0.02°,GRID50 起始 0.05°,宽度下限 0.005°。没有 numberMatched 且单块达到 10000 条就继续拆。WFS VERSION=2.0.0。仍失败的块进 failed_tiles,结束提示「有 N 块区域没读到,点继续重试」。writer 每 0.5 秒或 200 条 await to_thread(commit_many),只有真正写入才 completed += 1。_pump 用 TaskGroup,produce 用 aclosing。全市编号写 ids.spool,去重用 int,批量 fsync,meta 记已提交行数、complete 和 failedTiles。spool 完整且没有失败块时点继续不重读。request_stop 对进行中任务设 stopping=True。全市重新排队 listing_done=False。未知异常显示「下载失败,详情见日志」。已删 SSE /events。GET /api/download/active 返回 {count}。running_count 只统计 is_active 且 status 为 running。
与 C1 可能冲突:jobs.py 的 DownloadJob.emit、JobManager 的 place/pause/request_stop/running_count/resume_marked 以及文件后半的 run_download/_pump;router.py 的 _spawn、fill_slots、暂停/继续/取消、删掉的 /events 和新增的 /active。subscribers 字段仍留给 C1 的 dataclass,emit 不再使用。save/_load 没有改,failedTiles 暂存在 ids.spool.meta。C1 改 commit_many 时要保持写入后能从 journal.completed 看到编号。C1 改 load_ids 读 ids.txt 时,区域表任务已经在走这个接口。
偏离:宽度下限取 0.005°,没有 numberMatched 时 10000 条视为偏大。超时且仍能拆时不对同一大块等 1/3/9 秒。running_count 还要求状态为 running,暂停不占名额。_pump 仍接受可选 client,供旧测试传假客户端;生产路径传 None。suspend_all 没有内置 5 秒等待,留给 B 在关闭客户端前等待在途请求。Excel 占用和磁盘满的中文映射留给 C1。
给下个会话:合并 C2 时先看 jobs.py 和 router.py 与 C1 的交叉。不要删 ids.spool.meta 里的 failedTiles。不要把客户端再传回 run_download。不要跑 tauri dev,不要连真实 data。