mirror of https://github.com/microsoft/autogen.git
This commit makes the fix more robust. Seems to have solved the issue once and for all.
This commit is contained in:
parent
b27a041c51
commit
17eef3c450
|
@ -46,7 +46,13 @@ def message_handler():
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Sending message to connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
f"Sending message to connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
||||||
)
|
)
|
||||||
asyncio.run(websocket_manager.send_message(message, connection))
|
coro = websocket_manager.send_message(message, connection)
|
||||||
|
try:
|
||||||
|
loop = asyncio.get_running_loop()
|
||||||
|
asyncio.run_coroutine_threadsafe(coro, loop)
|
||||||
|
except RuntimeError:
|
||||||
|
asyncio.run(coro)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Skipping message for connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
f"Skipping message for connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
||||||
|
|
Loading…
Reference in New Issue