From 784e98f1dc1f6059a9ceeb301e22f8bbce398661 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 2 Dec 2025 22:46:52 -0800 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20=E4=BF=AE=E5=A4=8D=20health=20?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E4=BD=BF=E7=94=A8=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5=E7=AB=AF=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为每个微服务配置实际的健康检查端点路径 - 大多数服务使用 /api/v1/health - backup-service 和 reward-service 使用 /health - leaderboard-service 使用 /api/health - 新增 presence-service (端口 3011) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/services/deploy.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/backend/services/deploy.sh b/backend/services/deploy.sh index a3c3d0e6..cad50bba 100644 --- a/backend/services/deploy.sh +++ b/backend/services/deploy.sh @@ -256,25 +256,30 @@ status() { } health() { + # Format: "service-name:port:health-endpoint" local services=( - "identity-service:3000" - "wallet-service:3001" - "backup-service:3002" - "planting-service:3003" - "referral-service:3004" - "reward-service:3005" - "mpc-service:3006" - "leaderboard-service:3007" - "reporting-service:3008" - "authorization-service:3009" - "admin-service:3010" + "identity-service:3000:/api/v1/health" + "wallet-service:3001:/api/v1/health" + "backup-service:3002:/health" + "planting-service:3003:/api/v1/health" + "referral-service:3004:/api/v1/health" + "reward-service:3005:/health" + "mpc-service:3006:/api/v1/health" + "leaderboard-service:3007:/api/health" + "reporting-service:3008:/api/v1/health" + "authorization-service:3009:/api/v1/health" + "admin-service:3010:/api/v1/health" + "presence-service:3011:/api/v1/health" ) for svc in "${services[@]}"; do + # Parse service:port:endpoint name="${svc%%:*}" - port="${svc##*:}" + rest="${svc#*:}" + port="${rest%%:*}" + endpoint="${rest#*:}" - if curl -s -o /dev/null -w "%{http_code}" "http://localhost:$port/health" 2>/dev/null | grep -q "200"; then + if curl -s -o /dev/null -w "%{http_code}" "http://localhost:${port}${endpoint}" 2>/dev/null | grep -q "200"; then echo -e "${GREEN}[OK]${NC} $name (port $port)" else echo -e "${RED}[FAIL]${NC} $name (port $port)"