Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/document_anonymizer/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
from document_anonymizer.security.rate_limiter import RateLimiterMiddleware
from document_anonymizer.web.routes import web_router

configure_logging()
logger = structlog.get_logger(__name__)

_VERSION = importlib.metadata.version("document-anonymizer")


@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[None]: # noqa: ARG001
"""Eagerly load the analyzer engine on startup to fail fast."""
"""Configure logging and eagerly load the analyzer engine on startup."""
configure_logging()

from document_anonymizer.api.dependencies import get_analyzer

logger.info("startup", action="loading_analyzer_engine")
Expand Down