fix: use 10s timeout for remote service HTTP checks
This commit is contained in:
@@ -87,6 +87,11 @@ def http_check(url, timeout=5):
|
|||||||
return (False, str(e)[:60])
|
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):
|
def write_todo(name, issue, fix_script, fix_args, fix_cwd):
|
||||||
"""写一条 TODO 给 self_todo_executor 消费。
|
"""写一条 TODO 给 self_todo_executor 消费。
|
||||||
JSONL 每行一条,含 service/issue/时间/fix_action。
|
JSONL 每行一条,含 service/issue/时间/fix_action。
|
||||||
@@ -138,7 +143,8 @@ def main():
|
|||||||
# 3. HTTP health check(远程服务直接用 HTTP 判断)
|
# 3. HTTP health check(远程服务直接用 HTTP 判断)
|
||||||
http_msg = ""
|
http_msg = ""
|
||||||
if port_ok or is_remote:
|
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
|
# accept 401/403 as healthy if configured
|
||||||
if not ok and svc.get("accept_401") and ("401" in detail or "403" in detail):
|
if not ok and svc.get("accept_401") and ("401" in detail or "403" in detail):
|
||||||
http_msg = "auth (alive)"
|
http_msg = "auth (alive)"
|
||||||
|
|||||||
Reference in New Issue
Block a user