Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for shutdown_event (0.05 seconds)

  1. docs_src/events/tutorial002_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.on_event("shutdown")
    def shutdown_event():
        with open("log.txt", mode="a") as log:
            log.write("Application shutdown")
    
    
    @app.get("/items/")
    async def read_items():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 255 bytes
    - Click Count (0)
Back to Top