Basic working, no db

This commit is contained in:
2024-07-17 16:44:30 +02:00
parent fbb5ca762d
commit 7aef83360e
2 changed files with 34 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ recorder = PooRecorder()
@asynccontextmanager
async def _lifespan(_app: FastAPI):
async def _lifespan(_app: FastAPI): # noqa: ANN202
await recorder.start()
yield
await recorder.stop()
@@ -19,4 +19,5 @@ app = FastAPI(lifespan=_lifespan)
@app.put("/record/s={status}")
async def record(status: str) -> dict:
await recorder.record(status)
return {"status": status}