MCPcopy Index your code
hub / github.com/long2ice/fastapi-cache / lifespan

Function lifespan

examples/in_memory/main.py:17–19  ·  view source on GitHub ↗
(_: FastAPI)

Source from the content-addressed store, hash-verified

15
16@asynccontextmanager
17async def lifespan(_: FastAPI) -> AsyncIterator[None]:
18 FastAPICache.init(InMemoryBackend())
19 yield
20
21
22app = FastAPI(lifespan=lifespan)

Callers

nothing calls this directly

Calls 2

InMemoryBackendClass · 0.90
initMethod · 0.45

Tested by

no test coverage detected