Initial commit - Phase 3/4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
michael
2026-01-06 13:45:29 -08:00
parent 1da6730735
commit 4f35df1781
323 changed files with 98287 additions and 1195 deletions

View File

@@ -1,6 +1,7 @@
"""Health check endpoints."""
from fastapi import APIRouter
from pydantic import BaseModel
import aiosqlite
router = APIRouter()
@@ -21,6 +22,28 @@ async def health_check():
@router.get("/ready")
async def readiness_check():
"""Readiness check endpoint."""
# TODO: Check if PM3 is connected, database is accessible, etc.
return {"ready": True}
"""Readiness check endpoint.
Checks:
- Database connectivity
"""
from .. import config
checks = {"database": False}
reasons = []
# Check database connectivity
try:
async with aiosqlite.connect(config.DATABASE_PATH) as db:
await db.execute("SELECT 1")
checks["database"] = True
except Exception as e:
reasons.append(f"Database: {str(e)}")
all_ready = all(checks.values())
return {
"ready": all_ready,
"checks": checks,
"reasons": reasons if not all_ready else None
}