Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 3 of 3 for on_startup (0.06 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. tests/test_router_events.py

        app = FastAPI(on_startup=[app_startup], on_shutdown=[app_shutdown])
    
        @app.get("/")
        def main() -> dict[str, str]:
            return {"message": "Hello World"}
    
        def router_startup() -> None:
            state.router_startup = True
    
        def router_shutdown() -> None:
            state.router_shutdown = True
    
        router = APIRouter(on_startup=[router_startup], on_shutdown=[router_shutdown])
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 11.7K bytes
    - Click Count (0)
  2. fastapi/routing.py

                )
    
            # Handle on_startup/on_shutdown locally since Starlette removed support
            # Ref: https://github.com/Kludex/starlette/pull/3117
            # TODO: deprecate this once the lifespan (or alternative) interface is improved
            self.on_startup: list[Callable[[], Any]] = (
                [] if on_startup is None else list(on_startup)
            )
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
  3. docs/en/docs/release-notes.md

    ## 0.128.6 (2026-02-09)
    
    ### Fixes
    
    * 🐛 Fix `on_startup` and `on_shutdown` parameters of `APIRouter`. PR [#14873](https://github.com/fastapi/fastapi/pull/14873) by [@YuriiMotov](https://github.com/YuriiMotov).
    
    ### Translations
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Apr 03 12:07:04 GMT 2026
    - 631K bytes
    - Click Count (0)
Back to Top