From 49be78f16c943fc0bdda7a31670a2570ebc34467 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 5 Jun 2023 21:03:43 +0200 Subject: [PATCH] logs --- api/index.js | 2 +- src/api_communication/api_communication/api_listener.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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):