Skip to content

Commit

Permalink
Make thread as not daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
niemijoe committed Sep 5, 2022
1 parent 9ccd65e commit d24a653
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mqtt_data_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d24a653

Please sign in to comment.