feat: add update service env label

This commit is contained in:
2026-01-15 11:18:54 +01:00
parent f513d46d08
commit 8c55fd4954
7 changed files with 21 additions and 4 deletions

View File

@ -231,8 +231,16 @@ def get_service_status(settings: Settings) -> Dict[str, Any]:
"status_code": None,
"error": "update service url not configured",
"checked_url": "",
"environment": "unknown",
}
env = "prod"
lowered = base_url.lower()
if "://dev." in lowered or lowered.startswith("dev."):
env = "dev"
elif "://staging." in lowered or lowered.startswith("staging."):
env = "staging"
check_url = base_url
try:
with httpx.Client(timeout=3.0) as client:
@ -243,6 +251,7 @@ def get_service_status(settings: Settings) -> Dict[str, Any]:
"status_code": response.status_code,
"error": None,
"checked_url": check_url,
"environment": env,
}
except Exception as exc:
return {
@ -251,4 +260,5 @@ def get_service_status(settings: Settings) -> Dict[str, Any]:
"status_code": None,
"error": str(exc),
"checked_url": check_url,
"environment": env,
}