install: show wait progress, shorten OCR health wait, log to file.

This commit is contained in:
dekun
2026-06-28 14:58:06 +08:00
parent 04f1381a2d
commit edd3e80ef1
3 changed files with 25 additions and 23 deletions
+6 -1
View File
@@ -212,7 +212,7 @@ setup_ocr_gpu() {
fi
install_ocr_worker
start_ocr_screen
wait_ocr_healthy || log_warn "OCR 仍在加载模型,稍后可执行: bash ${INSTALL_DIR}/deploy/ocr-screen.sh status"
wait_ocr_healthy 30 || log_warn "OCR 后台加载中,继续安装主程序…"
}
stop_legacy_pm2() {
@@ -240,13 +240,18 @@ start_service() {
wait_healthy() {
local i
log_info "等待主程序就绪(最多 2 分钟)…"
for i in $(seq 1 40); do
if curl -sf "http://127.0.0.1:${WEB_PORT}/api/health" >/dev/null; then
log_info "主程序健康检查通过"
return 0
fi
if (( i % 5 == 0 )); then
echo -ne "\r${YELLOW}[INFO]${NC} 等待主程序… ${i}/40"
fi
sleep 3
done
echo ""
log_warn "主程序健康检查超时: journalctl -u grade-archive -f"
}