import requests import sys def check_health(url="http://localhost:5050/health"): try: response = requests.get(url, timeout=10) if response.status_code == 200: print("Health check passed") sys.exit(0) else: print(f"Health check failed: {response.status_code}") sys.exit(1) except requests.exceptions.RequestException as e: print(f"Health check failed: {e}") sys.exit(1) if __name__ == "__main__": check_health()