MCPcopy Create free account
hub / github.com/Roy3838/Observer / lifespan

Function lifespan

api/api.py:59–67  ·  view source on GitHub ↗
(app: FastAPI)

Source from the content-addressed store, hash-verified

57
58@asynccontextmanager
59async def lifespan(app: FastAPI):
60 # Runs once in each uvicorn worker, so each gets its own pool.
61 asyncio.get_running_loop().set_default_executor(
62 ThreadPoolExecutor(max_workers=IO_THREADS, thread_name_prefix="io")
63 )
64 await api_handlers.startup_handlers()
65 yield
66 await api_handlers.shutdown_handlers()
67 await close_redis()
68
69# Setup FastAPI app
70app = FastAPI(lifespan=lifespan)

Callers

nothing calls this directly

Calls 1

close_redisFunction · 0.90

Tested by

no test coverage detected