Merge pull request #260 from naturallaw777/copilot/fix-health-status-discrepancy
[WIP] Fix health status discrepancy between service tile and modal
This commit is contained in:
@@ -2432,6 +2432,27 @@ async def api_services():
|
|||||||
if ps == "closed":
|
if ps == "closed":
|
||||||
has_port_issues = True
|
has_port_issues = True
|
||||||
break
|
break
|
||||||
|
has_domain_issues = False
|
||||||
|
if needs_domain and domain and enabled:
|
||||||
|
dns_ok = True
|
||||||
|
try:
|
||||||
|
results = socket.getaddrinfo(domain, None)
|
||||||
|
if results:
|
||||||
|
resolved_ip = results[0][4][0]
|
||||||
|
if (
|
||||||
|
_cached_external_ip != "unavailable"
|
||||||
|
and resolved_ip != _cached_external_ip
|
||||||
|
):
|
||||||
|
dns_ok = False
|
||||||
|
else:
|
||||||
|
dns_ok = False
|
||||||
|
except (socket.gaierror, Exception):
|
||||||
|
dns_ok = False
|
||||||
|
|
||||||
|
if not dns_ok:
|
||||||
|
has_domain_issues = True
|
||||||
|
elif cached_reachable is False:
|
||||||
|
has_domain_issues = True
|
||||||
|
|
||||||
# Compute composite health
|
# Compute composite health
|
||||||
sync_progress: float | None = None
|
sync_progress: float | None = None
|
||||||
@@ -2441,7 +2462,6 @@ async def api_services():
|
|||||||
if not enabled:
|
if not enabled:
|
||||||
health = "disabled"
|
health = "disabled"
|
||||||
elif status == "active":
|
elif status == "active":
|
||||||
has_domain_issues = bool(needs_domain and domain and cached_reachable is False)
|
|
||||||
if has_port_issues:
|
if has_port_issues:
|
||||||
health = "needs_attention"
|
health = "needs_attention"
|
||||||
elif has_domain_issues:
|
elif has_domain_issues:
|
||||||
@@ -2464,7 +2484,6 @@ async def api_services():
|
|||||||
# For enabled services that are inactive (e.g. socket-activated PHP-FPM),
|
# For enabled services that are inactive (e.g. socket-activated PHP-FPM),
|
||||||
# still check domain/port health so status remains consistent with
|
# still check domain/port health so status remains consistent with
|
||||||
# other domain services when there are actionable issues.
|
# other domain services when there are actionable issues.
|
||||||
has_domain_issues = bool(needs_domain and domain and cached_reachable is False)
|
|
||||||
if has_port_issues:
|
if has_port_issues:
|
||||||
health = "needs_attention"
|
health = "needs_attention"
|
||||||
elif has_domain_issues:
|
elif has_domain_issues:
|
||||||
|
|||||||
Reference in New Issue
Block a user