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()