event loop issue

This commit is contained in:
Ken Wiltshire
2024-11-06 10:49:14 -05:00
parent f60368f8db
commit 8420cd1c77
2 changed files with 3 additions and 4626 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -52,15 +52,13 @@ from .base import (
QueryParam,
)
def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
try:
loop = asyncio.get_running_loop()
loop = asyncio.get_event_loop()
except RuntimeError:
logger.info("Creating a new event loop in main thread.")
# loop = asyncio.new_event_loop()
# asyncio.set_event_loop(loop)
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
return loop