diff --git a/gateway/scripts/agents_health_check.py b/gateway/scripts/agents_health_check.py index 4f250cc..491dd65 100644 --- a/gateway/scripts/agents_health_check.py +++ b/gateway/scripts/agents_health_check.py @@ -87,6 +87,11 @@ def http_check(url, timeout=5): return (False, str(e)[:60]) +def http_check_remote(url, timeout=10): + """远程 HTTP 检查,超时更长(跨网)。""" + return http_check(url, timeout=timeout) + + def write_todo(name, issue, fix_script, fix_args, fix_cwd): """写一条 TODO 给 self_todo_executor 消费。 JSONL 每行一条,含 service/issue/时间/fix_action。 @@ -138,7 +143,8 @@ def main(): # 3. HTTP health check(远程服务直接用 HTTP 判断) http_msg = "" if port_ok or is_remote: - ok, detail = http_check(svc["health_url"]) + checker = http_check_remote if is_remote else http_check + ok, detail = checker(svc["health_url"]) # accept 401/403 as healthy if configured if not ok and svc.get("accept_401") and ("401" in detail or "403" in detail): http_msg = "auth (alive)"