Add timeout for pesky long running HTTP POST.

This commit is contained in:
William Moore 2021-12-12 08:07:16 -06:00
parent 2ec9f47eb0
commit 730d5c7413

View File

@ -34,7 +34,7 @@ class tempThread (threading.Thread):
temp = sensor.temperature
print(temp)
if temp > set_point:
requests.post(os.environ.get('NOTIF_URL'), data={'message': 'The water is too damn hot!', 'title': 'Water temperature'})
requests.post(os.environ.get('NOTIF_URL'), data={'message': 'The water is too damn hot!', 'title': 'Water temperature'}, timeout=5)
time.sleep(5)
T_thread = tempThread()