Template
mirror of
https://github.com/Nekidev/uv-fastapi-tortoise.git
synced 2026-09-12 19:57:25 +00:00
15 lines
245 B
Python
15 lines
245 B
Python
from fastapi import FastAPI
|
|
|
|
from contextlib import asynccontextmanager
|
|
|
|
from project.db.lifespan import on_startup, on_shutdown
|
|
|
|
|
|
@asynccontextmanager
|
|
async def lifespan(app: FastAPI):
|
|
await on_startup()
|
|
|
|
yield
|
|
|
|
await on_shutdown()
|