We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0646df commit b402722Copy full SHA for b402722
1 file changed
web/server/main.py
@@ -10,6 +10,7 @@
10
from web.server.api.endpoints import api_router
11
from web.server.console import api_console
12
from web.server.exceptions import ApiException
13
+from web.server.settings import get_context, get_settings
14
from web.server.watcher import watch_project
15
16
app = FastAPI()
@@ -39,9 +40,11 @@ async def dispatch() -> None:
39
40
41
42
@app.on_event("shutdown")
-def shutdown_event() -> None:
43
+async def shutdown_event() -> None:
44
app.state.dispatch_task.cancel()
45
app.state.watch_task.cancel()
46
+ context = await get_context(settings=get_settings())
47
+ context.close()
48
49
50
@app.exception_handler(ApiException)
0 commit comments