diff --git a/api/index.js b/api/index.js index 6308284b..79acf474 100644 --- a/api/index.js +++ b/api/index.js @@ -18,7 +18,7 @@ var ws; var api_connected = false; function send_events_to_clients(data) { - // console.log("sending events to clients"); + console.log("sending events to clients"); sse_clients.forEach((client) => { client.response.write("event: message\n"); client.response.write("data:" + JSON.stringify(data) + "\n\n"); diff --git a/src/api_communication/api_communication/api_listener.py b/src/api_communication/api_communication/api_listener.py index c6d63d2b..42dd48dd 100644 --- a/src/api_communication/api_communication/api_listener.py +++ b/src/api_communication/api_communication/api_listener.py @@ -187,8 +187,8 @@ class ApiListener(Node): """Thread to handle responses to send to the client """ while True: - if len(self.message_queue) > 0 and self.websocket is not None and self.event_loop is not None: - # self.get_logger().info("sending message") + if len(self.message_queue) > 0 and self.websocket is not None: + self.get_logger().info("sending message") asyncio.run(self.publish_message(self.message_queue.pop(0))) def start_api_thread(self):