From d24a653eb8ce5032e54f2ba5461b8dd412eb1964 Mon Sep 17 00:00:00 2001 From: niemijoe Date: Mon, 5 Sep 2022 16:02:22 +0300 Subject: [PATCH] Make thread as not daemon --- mqtt_data_collector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mqtt_data_collector.py b/mqtt_data_collector.py index 746fb4e..a697ba3 100644 --- a/mqtt_data_collector.py +++ b/mqtt_data_collector.py @@ -111,10 +111,11 @@ def main(): if topic.is_running == False: print(f"Topic {topic.topic_name} was not running, starting it.") - # Run listen_topic in a thread because we don't want to wait e.g. client.connect() etc. + # Run listen_topic in a thread because we don't want to wait e.g. client.connect() # If we didn't use threads here, one connection being stuck could cause long # timeout for sending data to Azure. t = Thread(target=topic.listen_topic) + t.daemon = False t.start() sleep_time = time_end - time.time()