feat(healthcheck): enhance health check functionality and serve favicon directly

This commit is contained in:
pacnpal
2025-01-29 12:36:07 -05:00
parent 5430ec6ad4
commit 79e6bc3f9a
2 changed files with 16 additions and 6 deletions

View File

@@ -5,10 +5,11 @@ import os
def check_health():
try:
host = os.environ.get('ADGUARD_HOST', 'http://localhost')
host = os.environ.get('ADGUARD_HOST', 'localhost')
port = os.environ.get('ADGUARD_PORT', '8000')
url = f'http://{host}:{port}/health'
with httpx.Client() as client:
response = client.get('http://localhost:8000/health')
response = client.get(url)
response.raise_for_status()
print('✅ Service is healthy')
sys.exit(0)