bug fix issue #95

This commit is contained in:
benx13
2024-11-05 18:36:59 -08:00
parent b4ab9b26b8
commit 6f77f54c6d
2 changed files with 40 additions and 23 deletions

View File

@@ -55,13 +55,12 @@ from .base import (
def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
try:
loop = asyncio.get_running_loop()
return 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()
return loop
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
return loop
@dataclass