Uvloop_helper should use "get_running_loop"
This commit is contained in:
parent
550a1eef91
commit
c9296dc9a0
@ -47,7 +47,7 @@ class UvicornServer(uvicorn.Server):
|
|||||||
else:
|
else:
|
||||||
asyncio.set_event_loop(uvloop.new_event_loop())
|
asyncio.set_event_loop(uvloop.new_event_loop())
|
||||||
try:
|
try:
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_running_loop()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
# When running in a thread, we'll not have an eventloop yet.
|
# When running in a thread, we'll not have an eventloop yet.
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
|
Loading…
Reference in New Issue
Block a user