File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/service-library/src/servicelib/fastapi/celery Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1+ import datetime
2+ from typing import Final
3+
14from asgi_lifespan import LifespanManager
25from fastapi import FastAPI
36
47from ...celery .app_server import BaseAppServer
58
9+ _SHUTDOWN_TIMEOUT : Final [float ] = datetime .timedelta (seconds = 10 ).total_seconds ()
10+
611
712class FastAPIAppServer (BaseAppServer [FastAPI ]):
813 def __init__ (self , app : FastAPI ):
@@ -13,7 +18,7 @@ async def on_startup(self) -> None:
1318 self ._lifespan_manager = LifespanManager (
1419 self .app ,
1520 startup_timeout = None , # waits for full app initialization (DB migrations, etc.)
16- shutdown_timeout = None ,
21+ shutdown_timeout = _SHUTDOWN_TIMEOUT ,
1722 )
1823 await self ._lifespan_manager .__aenter__ ()
1924
You can’t perform that action at this time.
0 commit comments