WeKnora 可恢复批量同步恢复方案
956
旧同步包数
33
旧成功包数
923
旧失败包数
922
当前可恢复匹配
结论
认证问题已解除,失败原因转为本机 WeKnora Lite 在连续全量写入时承压退出或拒绝连接。脚本已改成可按失败 manifest 恢复、按批次限速、批次间 health check、失败重试和指数退避。
恢复命令
WEKNORA_HTTP_TIMEOUT=30 python3 control/scripts/sync_zhctprompt_to_weknora.py \ --resume-failed \ --batch-size 10 \ --sleep-between-docs 1.5 \ --retry-attempts 3 \ --retry-sleep-seconds 5 \ --retry-backoff-multiplier 2 \ --health-attempts 6 \ --health-sleep-seconds 10 \ --health-backoff-multiplier 2
验证结果
| 检查项 | 结果 |
|---|---|
| Python 语法检查 | 通过 |
| CLI 参数可见性 | 通过,help 中包含 resume、batch、sleep、retry、health 参数 |
| WeKnora backend health | HTTP 200,{"status":"ok"} |
| WeKnora frontend | HTTP 200 |
| 恢复 dry-run | 当前 963 包中匹配 922 个恢复目标 |
| 旧失败差异 | 旧 923 个失败包中 1 个当前不再生成:[ZHCT项目知识包] 60-other part 19 |
| Whitespace 检查 | git diff --check 通过 |
边界
本轮没有直接执行 922 包真实写入;恢复命令可执行,但建议先按保守批次运行,观察每批 summary、manifest 和 health 结果。中途服务退出时,重启 LaunchAgent 后重复执行同一条 --resume-failed 命令。