1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-07 23:03:36 +02:00
Files
immich/machine-learning/scripts/healthcheck.py
2025-07-14 18:08:29 -04:00

18 lines
368 B
Python

import os
import sys
import requests
port = os.getenv("IMMICH_PORT", 3003)
host = os.getenv("IMMICH_HOST", "0.0.0.0")
host = "localhost" if host == "0.0.0.0" else host
try:
response = requests.get(f"http://{host}:{port}/ping", timeout=2)
if response.status_code == 200:
sys.exit(0)
sys.exit(1)
except requests.RequestException:
sys.exit(1)