event loop issue
This commit is contained in:
parent
c523dd60ac
commit
a73ef6ec5a
2 changed files with 3 additions and 4626 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -52,15 +52,13 @@ from .base import (
|
||||||
QueryParam,
|
QueryParam,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
|
def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
|
||||||
try:
|
try:
|
||||||
loop = asyncio.get_running_loop()
|
loop = asyncio.get_event_loop()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
logger.info("Creating a new event loop in main thread.")
|
logger.info("Creating a new event loop in main thread.")
|
||||||
# loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
# asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
loop = asyncio.get_event_loop()
|
|
||||||
return loop
|
return loop
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue