style(rmi-backend): complete lint cleanup — 1175→0 ruff errors
- Fix 71 invalid-syntax files (class-body newline-broken assignments) - Add from/None chain to 307 B904 raise-without-from sites - Add B008 ignore to ruff.toml (already in pyproject.toml) - Noqa F401 on __init__.py re-exports (137 sites) - Noqa E402 on deferred imports (63 sites) - Bulk-add stdlib/FastAPI/project imports for F821 (127 sites) - Replace ×→x, –→-, …→... in docstrings (4093 chars) - Manual refactor of 5 SIM103/SIM116 patterns Tests: 791 passed (66 deselected due to pre-existing Redis issues in test_rag.py) Co-authored-by: opencode <opencode@rugmunch.io>
This commit is contained in:
parent
ca9bdce365
commit
c762564d40
688 changed files with 5165 additions and 5142 deletions
|
|
@ -1,4 +1,4 @@
|
|||
"""Auto-Healing Infrastructure — self-diagnosing, self-repairing platform."""
|
||||
"""Auto-Healing Infrastructure - self-diagnosing, self-repairing platform."""
|
||||
|
||||
import os
|
||||
from datetime import UTC, datetime
|
||||
|
|
@ -22,7 +22,7 @@ CHECKS = [
|
|||
|
||||
@router.get("/full")
|
||||
async def full_health_check():
|
||||
"""Comprehensive system health check — all services."""
|
||||
"""Comprehensive system health check - all services."""
|
||||
results = {}
|
||||
all_healthy = True
|
||||
|
||||
|
|
@ -62,11 +62,11 @@ def _check_alerts(mem, disk) -> list:
|
|||
"""Generate alerts for concerning metrics."""
|
||||
alerts = []
|
||||
if mem.percent > 90:
|
||||
alerts.append({"level": "CRITICAL", "msg": f"Memory usage at {mem.percent}% — consider restarting services"})
|
||||
alerts.append({"level": "CRITICAL", "msg": f"Memory usage at {mem.percent}% - consider restarting services"})
|
||||
elif mem.percent > 80:
|
||||
alerts.append({"level": "WARNING", "msg": f"Memory usage at {mem.percent}%"})
|
||||
if disk.percent > 90:
|
||||
alerts.append({"level": "CRITICAL", "msg": f"Disk usage at {disk.percent}% — prune logs immediately"})
|
||||
alerts.append({"level": "CRITICAL", "msg": f"Disk usage at {disk.percent}% - prune logs immediately"})
|
||||
elif disk.percent > 80:
|
||||
alerts.append({"level": "WARNING", "msg": f"Disk usage at {disk.percent}%"})
|
||||
return alerts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue