fix: wait for req socket send to make sure we dont stay stuck - if there's no... #23
@@ -77,7 +77,7 @@ class RICommunicationAgent(BaseAgent):
|
|||||||
topic = b"ping"
|
topic = b"ping"
|
||||||
data = json.dumps(False).encode()
|
data = json.dumps(False).encode()
|
||||||
if self.agent.pub_socket is None:
|
if self.agent.pub_socket is None:
|
||||||
self.agent.logger.error(
|
self.agent.logger.warning(
|
||||||
"Communication agent pub socket not correctly initialized."
|
"Communication agent pub socket not correctly initialized."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -227,7 +227,7 @@ class RICommunicationAgent(BaseAgent):
|
|||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.logger.error("Failed to set up %s after %d retries", self.name, max_retries)
|
self.logger.warning("Failed to set up %s after %d retries", self.name, max_retries)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Set up ping behaviour
|
# Set up ping behaviour
|
||||||
@@ -238,7 +238,7 @@ class RICommunicationAgent(BaseAgent):
|
|||||||
topic = b"ping"
|
topic = b"ping"
|
||||||
data = json.dumps(True).encode()
|
data = json.dumps(True).encode()
|
||||||
if self.pub_socket is None:
|
if self.pub_socket is None:
|
||||||
self.logger.error("Communication agent pub socket not correctly initialized.")
|
self.logger.warning("Communication agent pub socket not correctly initialized.")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
await asyncio.wait_for(self.pub_socket.send_multipart([topic, data]), 5)
|
await asyncio.wait_for(self.pub_socket.send_multipart([topic, data]), 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user