INNER CODE UNIT · Python

readiness

KatrielMoses/voidaccess · api/main.py:606

async def readiness() -> dict:
    """Readiness probe — checks DB and Tor are reachable."""
    checks = {}
    db_result, tor_result = await asyncio.gather(
        _check_db_connectivity_async(),
        _check_tor_connectivity_async(),
    )
    checks["database"] = db_result
    checks["tor"] = tor_result

    is_ready = all(v == "ok" for v in checks.values())
    status = "ready" if is_ready else "not_ready"
    return {"status": status, "checks": checks}


@app.get("/debug/tor-test", tags=["health"])
async def tor_test(_=Depends(get_current_user)) -> dict:
    """

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…