graphai.api.main.main module
- graphai.api.main.main.lifespan(app: FastAPI)
- This function has three parts:
Before startup: Logic executed right before starting the API. Here we might want to load big objects into memory, etc.
Yield: This is the standard way of passing the execution to the FastAPI app, so it can normally boot and serve requests.
After shutdown: Logic executed right after shutting down the API. Here we might want to free some memory, do some cleanup, etc.
- async graphai.api.main.main.redirect_docs()