File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 2
2
from contextlib import contextmanager
3
3
from inspect import isawaitable
4
4
5
- from fastapi import Depends , Request
6
5
7
6
ASGI = {"spec_version" : "2.0" , "version" : "3.0" }
8
7
@@ -16,11 +15,6 @@ def run_in_background(coro):
16
15
fut .add_done_callback (background_tasks .discard )
17
16
18
17
19
- @Depends
20
- async def env (request : Request ):
21
- return request .scope ["env" ]
22
-
23
-
24
18
@contextmanager
25
19
def acquire_js_buffer (pybuffer ):
26
20
from pyodide .ffi import create_proxy
@@ -84,11 +78,10 @@ async def receive():
84
78
85
79
async def send (got ):
86
80
if got ["type" ] == "lifespan.startup.complete" :
87
- print ("Application startup complete." )
88
- print ("Uvicorn running" )
89
81
ready .set_result (None )
82
+ return
90
83
if got ["type" ] == "lifespan.shutdown.complete" :
91
- print ( "Application shutdown complete" )
84
+ return
92
85
raise RuntimeError (f"Unexpected lifespan event { got ['type' ]} " )
93
86
94
87
run_in_background (
You can’t perform that action at this time.
0 commit comments