asyncgenerator fix

This commit is contained in:
John Lancaster
2026-07-30 20:51:16 -05:00
parent 70695ff218
commit 1ed5856db0
6 changed files with 19 additions and 19 deletions
@@ -64,14 +64,14 @@ Resolve settings at the composition boundary and call `get_engine(settings.datab
The lifespan context manager only connects the cached resource to FastAPI ownership:
```python
from collections.abc import AsyncIterator
from collections.abc import AsyncGeneratorr
from contextlib import asynccontextmanager
from fastapi import FastAPI
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[None]:
async def lifespan(app: FastAPI) -> AsyncGenerator[None]:
database_url = app.state.settings.database_url
engine = get_engine(database_url)
app.state.engine = engine