Files
stock-info-crawler/health_check.py
2025-09-03 16:47:02 +08:00

15 lines
388 B
Python

#!/usr/bin/env python3
import requests
import sys
try:
response = requests.get('http://localhost:8080/health', timeout=5)
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 Exception as e:
print(f"Health check error: {e}")
sys.exit(1)