fix(client): apply 与 status 落进 20s 默认超时被 abort

apiTimeoutMs() 只给 /dsh-purge/update(POST 180s / GET 45s)、
/dsh-purge/uninstall(90s)、/dsh-purge/skill 三类例外,其余一律落到
return 20000。apply 与 status 都在这个默认值里。

补丁条目较多时应用一遍必然超过 20 秒(每条都要读文件、比对 marker、写回),
后端又是同步落盘,期间 status 也会被阻塞。前端 AbortController 到点 abort,
isAbortError() 把它转成 new Error("timeout"),界面渲染成「读取失败: timeout」。
后端其实还在正常跑完,只是前端不再等待。

补上四个超时:status 60s、apply 240s、revert 120s、restart 60s。
This commit is contained in:
fomaper committed 2026-10-11 07:59:59 +08:00
1 parent beae190918
commit 3a2e7c225e
1 file changed
+5
+5
View File
@@ -46,6 +46,11 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
if (path.indexOf("/dsh-purge/update") !== -1) return method === "POST" ? 180000 : 45000;
if (path.indexOf("/dsh-purge/uninstall") !== -1) return 90000;
if (path.indexOf("/dsh-purge/skill") !== -1) return method === "POST" ? 120000 : 20000;
// status 会在"应用"期间被后端的同步落盘阻塞,默认 20s 必然被 abort,界面只会显示"读取失败: timeout"。
if (path.indexOf("/dsh-purge/status") !== -1) return 60000;
if (path.indexOf("/dsh-purge/apply") !== -1) return 240000;
if (path.indexOf("/dsh-purge/revert") !== -1) return 120000;
if (path.indexOf("/dsh-purge/restart") !== -1) return 60000;
return 20000;
}
function isAbortError(e) {