Uvloop_helper should use "get_running_loop"

This commit is contained in:
Matthias 2021-12-31 13:01:13 +01:00
parent 550a1eef91
commit c9296dc9a0
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class UvicornServer(uvicorn.Server):
else:
asyncio.set_event_loop(uvloop.new_event_loop())
try:
loop = asyncio.get_event_loop()
loop = asyncio.get_running_loop()
except RuntimeError:
# When running in a thread, we'll not have an eventloop yet.
loop = asyncio.new_event_loop()