Return the shared HTTP client. Requires startup_handlers() to have run.
()
| 18 | _shared_http_client: Optional[httpx.AsyncClient] = None |
| 19 | |
| 20 | def get_http_client() -> httpx.AsyncClient: |
| 21 | """Return the shared HTTP client. Requires startup_handlers() to have run.""" |
| 22 | if _shared_http_client is None: |
| 23 | raise RuntimeError("Shared HTTP client not initialized.") |
| 24 | return _shared_http_client |
| 25 | |
| 26 | async def startup_handlers(): |
| 27 | """Initialize shared resources. Called from FastAPI lifespan on startup.""" |
no outgoing calls
no test coverage detected