| 669 | |
| 670 | |
| 671 | def check_health(api_base_url: str) -> bool: |
| 672 | health_url = api_base_url.rstrip("/") + "/health" |
| 673 | try: |
| 674 | response = requests.get(health_url, timeout=5) |
| 675 | if response.status_code == 200: |
| 676 | print(f"[HEALTH] {health_url} is healthy.") |
| 677 | return True |
| 678 | else: |
| 679 | print(f"[HEALTH] {health_url} returned status {response.status_code}") |
| 680 | return False |
| 681 | except Exception as e: |
| 682 | print(f"[HEALTH] Failed to connect to {health_url}: {e}") |
| 683 | return False |
| 684 | |
| 685 | |
| 686 | def main(args: argparse.Namespace): |