From c40984337705144835b7ba925ab250cd0becaa4f Mon Sep 17 00:00:00 2001 From: fomaper <38674512+fomaper@users.noreply.github.com> Date: Sun, 11 Oct 2026 08:00:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20=E9=87=8D=E5=90=AF=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=20inflight=20=E7=AA=97=E5=8F=A3=20180s=20=E6=94=B6?= =?UTF-8?q?=E5=88=B0=2045s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit officialRestartScript() 末尾的 WScript.Sleep(180000) 持有 %TEMP%\dsh-purge-official-restarting,而 ASAR_RENAME_WHEN_IDLE_PS1 看到该标记且 age < 180 s 就 exit 0,不做换包。结果是重启完成后约三分钟内, 面板里的操作都没有响应。 冷启动用不到 180 s:桌面宿主从进程创建到插件 boot 完成实测约十几秒。 收到 45 s 仍留了足够余量覆盖较慢的冷启动。 如果 180 s 是有意留的更大余量,这一条可以不用。 --- lib/desktop.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/desktop.js b/lib/desktop.js index df58ac3..8873e98 100644 --- a/lib/desktop.js +++ b/lib/desktop.js @@ -1309,7 +1309,9 @@ function officialRestartScript(exe, asar, dshHome) { "log('started');", "}", "}", - "WScript.Sleep(180000);", + // Keep the inflight window just long enough to cover a cold client start; + // the original 180s left the panel unresponsive for 3 minutes after every restart. + "WScript.Sleep(45000);", "try { if (fso.FileExists(" + jsString(path.join(os.tmpdir(), "dsh-purge-official-restarting")) + ")) fso.DeleteFile(" + jsString(path.join(os.tmpdir(), "dsh-purge-official-restarting")) + ", true); } catch (ignoreFlag) {}", "", ].join("\r\n");