From b956951178361478f009c5338588ef17d7cccded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 15:58:07 +0100 Subject: [PATCH] added reult as args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/app.py b/server/app.py index 8c91ab8..555db3a 100644 --- a/server/app.py +++ b/server/app.py @@ -118,14 +118,13 @@ def update_tube_index(): print("Updated index: "+str(result)) time.sleep(10) -def start_mqtt_publishers(): +def start_mqtt_publishers(result): # Create and start a thread for each universe mqtt_client = connect_mqtt() artnetBindIp = get_eth0_ip() artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454) cur = db.cursor() cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") - global result result = cur.fetchall() cur.close() while True: @@ -158,5 +157,5 @@ if __name__ == "__main__": tube_index_updater_thread.start() flask_thread = Process(target=flask_api) flask_thread.start() - publisher_thread = Process(target=start_mqtt_publishers) + publisher_thread = Process(target=start_mqtt_publishers, args=(result, )) publisher_thread.start()