MCPcopy Create free account
hub / github.com/fastapi/fastapi / shutdown_event

Function shutdown_event

docs_src/events/tutorial002_py310.py:7–9  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6@app.on_event("shutdown")
7def shutdown_event():
8 with open("log.txt", mode="a") as log:
9 log.write("Application shutdown")
10
11
12@app.get("/items/")

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected