From 60599545960af5c8c9dae70d24ece4eefc2a0467 Mon Sep 17 00:00:00 2001 From: zxyszx <299979470+zxyszx@users.noreply.github.com> Date: Mon, 3 Aug 2026 16:49:33 +0800 Subject: [PATCH] fix: honor custom HTTP bind in health checks --- install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 848e94b..374fb4b 100755 --- a/install.sh +++ b/install.sh @@ -157,9 +157,12 @@ prepare_directories() { } wait_for_health() { - local attempts="${1:-60}" + local attempts="${1:-60}" bind port + bind="$(env_value LANQIN_HTTP_BIND || true)" + bind="${bind:-80}" + port="${bind##*:}" for ((i=1; i<=attempts; i++)); do - if curl -fsS --max-time 3 http://127.0.0.1/healthz >/dev/null 2>&1; then + if curl -fsS --max-time 3 "http://127.0.0.1:${port}/healthz" >/dev/null 2>&1; then return 0 fi sleep 2 @@ -237,7 +240,7 @@ do_rollback() { do_status() { [[ -f "${INSTALL_DIR}/docker-compose.yml" ]] || fail "尚未安装。" compose ps - if curl -fsS --max-time 3 http://127.0.0.1/healthz >/dev/null 2>&1; then + if wait_for_health 1; then success "Web 与 API 健康检查正常。" else fail "健康检查失败。"