From 0f78218ab7f0820fc6f7b4af1d78806c76071bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 16:24:04 +0100 Subject: [PATCH] global declaration at script start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/app.py b/server/app.py index 55d1110..c84c3ad 100644 --- a/server/app.py +++ b/server/app.py @@ -45,6 +45,7 @@ mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address cur = db.cursor() cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") +global TUBE_INDEX TUBE_INDEX = cur.fetchall() cur.close() @@ -156,6 +157,8 @@ def mqtt_publisher(): sys.exit() if __name__ == "__main__": + tube_index_updater_thread = Process(target=update_tube_index) + tube_index_updater_thread.start() flask_thread = Process(target=flask_api) flask_thread.start() publisher_thread = Process(target=mqtt_publisher)