dsh-update-center 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/data/extra-plugins.json +3 -3
- package/data/registry-snapshot.json +523 -373
- package/lib/client.js +12 -3
- package/lib/client.js.map +1 -1
- package/lib/index.js +149 -19
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/plugins.json +523 -373
- package/scripts/restart-dsh.mjs +19 -2
- package/scripts/update-worker.mjs +765 -598
package/scripts/restart-dsh.mjs
CHANGED
|
@@ -113,9 +113,26 @@ function main() {
|
|
|
113
113
|
stdio: ['ignore', outFd, errFd],
|
|
114
114
|
windowsHide: true,
|
|
115
115
|
})
|
|
116
|
-
|
|
116
|
+
// 启动存活观察:spawn 成功不等于 dsh 真起来了——运行时崩溃(缺模块、
|
|
117
|
+
// 端口被占、补丁失效等)通常发生在头几秒。助手保留 15 秒观察期,期间
|
|
118
|
+
// 进程退出就把结论写进日志,避免"面板提示已重启、服务其实没起来"的
|
|
119
|
+
// 静默失败(重启助手之前是拉起即退出,无从得知)。
|
|
120
|
+
const startedAt = Date.now()
|
|
121
|
+
let exited = false
|
|
122
|
+
child.on('error', (error) => {
|
|
123
|
+
try {
|
|
124
|
+
appendFileSync(stderrLog, `[restart] 新进程拉起失败:${error}\n`)
|
|
125
|
+
} catch { /* 日志写失败无处报告 */ }
|
|
126
|
+
process.exit(1)
|
|
127
|
+
})
|
|
128
|
+
child.on('exit', (code, signal) => {
|
|
129
|
+
exited = true
|
|
130
|
+
try {
|
|
131
|
+
appendFileSync(stderrLog, `[restart] 新进程启动 ${Math.round((Date.now() - startedAt) / 1000)}s 后退出(code=${code ?? '-'} signal=${signal ?? '-'}),dsh 未成功重启。请查看本文件与 dsh-web.stdout.log 定位原因;可用 Start-DSH 手动拉起,或回退 dsh 后再试。\n`)
|
|
132
|
+
} catch { /* 日志写失败无处报告 */ }
|
|
133
|
+
})
|
|
117
134
|
child.unref()
|
|
118
|
-
process.exit(0)
|
|
135
|
+
setTimeout(() => process.exit(exited ? 1 : 0), 15_000)
|
|
119
136
|
}, killWaitMs)
|
|
120
137
|
}, delayMs)
|
|
121
138
|
}
|