fix(health-checker): prevent TypeError when health_score is null in database

This commit is contained in:
Inaki Fernandez
2026-07-12 17:37:21 +02:00
parent 71037601e4
commit 6a6663027a

View File

@@ -208,7 +208,9 @@ class IntelligentLinkCleaner:
log_event("FINALIZING STATUS AND METRICS...", section_break=True)
for url, (alive, reason, final) in check_results.items():
nu = normalize_url(url); entry = self.inventory.get(nu, {})
score = entry.get("health_score", 100)
score = entry.get("health_score")
if score is None:
score = 100.0
score = (score * 0.8) + (100 if alive else 0) * 0.2
entry["health_score"] = round(score, 1); entry["last_checked"] = datetime.now().timestamp()