install: show wait progress, shorten OCR health wait, log to file.
This commit is contained in:
+6
-1
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user