Buckets:

download
raw
924 Bytes
"""Health check endpoints."""
from __future__ import annotations
from fastapi import APIRouter
from pydantic import BaseModel
from malwar import __version__
router = APIRouter()
class HealthResponse(BaseModel):
status: str
service: str
version: str
class ReadyResponse(BaseModel):
status: str
database: str
@router.get("/health", response_model=HealthResponse)
async def health() -> HealthResponse:
return HealthResponse(status="ok", service="malwar", version=__version__)
@router.get("/ready", response_model=ReadyResponse)
async def ready() -> ReadyResponse:
from malwar.storage.database import get_db
try:
db = await get_db()
cursor = await db.execute("SELECT 1")
await cursor.fetchone()
return ReadyResponse(status="ready", database="connected")
except Exception as exc:
return ReadyResponse(status="not_ready", database=str(exc))

Xet Storage Details

Size:
924 Bytes
·
Xet hash:
ab98ca45135dfa113e8ebb91f35e74cc65bccfed9d896d423035a7e123ce6351

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.