File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ def __init__(self) -> None:
4848 self .default_headers : list [tuple [bytes , bytes ]] = []
4949
5050
51+ class ShutdownTrigger :
52+ is_shutdown_triggered : bool = False
53+
54+
5155class Server :
5256 def __init__ (self , config : Config ) -> None :
5357 self .config = config
@@ -261,7 +265,7 @@ async def on_tick(self, counter: int) -> bool:
261265 async def shutdown (self , sockets : list [socket .socket ] | None = None ) -> None :
262266 if self .config .shutdown_delay :
263267 logger .info (f"Shutting down in { self .config .shutdown_delay } seconds" )
264- self . config . app . uvicorn_shutdown_triggered = True
268+ ShutdownTrigger . is_shutdown_triggered = True
265269 await asyncio .sleep (self .config .shutdown_delay )
266270
267271 logger .info ("Shutting down" )
You can’t perform that action at this time.
0 commit comments