From b90817b892ca775ceec4520257c7e10ca6b5d19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 03:09:46 +0100 Subject: [PATCH] added while MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/app.py b/server/app.py index c59714d..db05c1a 100644 --- a/server/app.py +++ b/server/app.py @@ -176,10 +176,11 @@ def start_mqtt_publishers(): sys.exit() def update_tube_index(): - cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") - global result - result = cur.fetchall() - time.sleep(2) + while True: + time.sleep(2) + cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") + global result + result = cur.fetchall() if __name__ == "__main__": flask_thread = Process(target=flask_api)