From 730d5c74138fe80865496b2ab7c6a149d9e08530 Mon Sep 17 00:00:00 2001 From: William Moore Date: Sun, 12 Dec 2021 08:07:16 -0600 Subject: [PATCH] Add timeout for pesky long running HTTP POST. --- temperato.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temperato.py b/temperato.py index 48e7bd0..d8ef479 100644 --- a/temperato.py +++ b/temperato.py @@ -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()