(_: FastAPI)
| 22 | |
| 23 | @asynccontextmanager |
| 24 | async def lifespan(_: FastAPI) -> AsyncIterator[None]: |
| 25 | pool = ConnectionPool.from_url(url="redis://redis") |
| 26 | r = redis.Redis(connection_pool=pool) |
| 27 | FastAPICache.init(RedisBackend(r), prefix="fastapi-cache") |
| 28 | yield |
| 29 | |
| 30 | |
| 31 | app = FastAPI(lifespan=lifespan) |
nothing calls this directly
no test coverage detected