added while loop and a 5 sec sleeper
Signed-off-by: Ebbe Baß <ebbe.bass>
This commit is contained in:
+10
-8
@@ -141,15 +141,17 @@ def mqtt_publisher(data_queue):
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def tube_index_updater(data_queue):
|
def tube_index_updater(data_queue):
|
||||||
try:
|
while True:
|
||||||
cur = db.cursor()
|
try:
|
||||||
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
cur = db.cursor()
|
||||||
tube_index = cur.fetchall()
|
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
||||||
cur.close()
|
tube_index = cur.fetchall()
|
||||||
data_queue.put(tube_index)
|
cur.close()
|
||||||
|
data_queue.put(tube_index)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
data_queue = Queue()
|
data_queue = Queue()
|
||||||
|
|||||||
Reference in New Issue
Block a user