event loop issue
This commit is contained in:
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
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user