fix(update): 检查更新增加重试与镜像回退,错误提示本地化并缩短失败缓存 - #625
Open
miaowmint wants to merge 2 commits into
Open
Conversation
- fetch_pypi_info 改为多源探测:pypi.org 重试 2 次,失败回退腾讯云/阿里云镜像 JSON API,透出 source 字段 - /update/status 与 /update/check 增加 error_code(pypi_unreachable)与 source 字段 - 失败探测的缓存 TTL 从 1 小时缩短为 5 分钟(后端内存缓存 + 前端 localStorage),网络恢复后自动重新探测 - 版本升级界面错误文案支持中英本地化(errors.pypi_unreachable),镜像来源显示提示 - octop update 失败提示补充网络/代理排查建议 - 新增 self_update 重试/回退与 update router 错误码/短 TTL 单测,前端缓存测试覆盖错误态 TTL
- PyPI 源表增加 per-source 超时:pypi.org 3s×2(SYN 被丢时快速失败), 镜像 8s;「官方不通、镜像可用」从 ~16.5s 降到 ~6.5s,全源失败最坏 ~31s - fetch_pypi_info/fetch_latest_pypi_version 移除已无意义的 timeout 参数 - isUpdateStatusCacheExpired 改用与 readStoredUpdateStatus 相同的按状态 TTL(成功 1h / 失败 5min),不再固定 1h - UPDATE_STATUS_POLL_MS 改为 60s 廉价 tick(TTL gate 决定是否真正探测), 失败态在错误 TTL 过后自动重探 - 升级页显示错误时挂 60s interval 自动 getUpdateStatus,红字随网络恢复 自动消失 - 测试:官方/镜像超时分级断言、前端失败自愈与 expiry 一致性用例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
make allpasses locallyChecklist
CHANGELOG.md(if user-facing)