From 93c71ad10ee485a675fde536d41d9721bd55b3c2 Mon Sep 17 00:00:00 2001 From: Di Wu Date: Fri, 30 Oct 2015 23:47:07 -0700 Subject: [PATCH] timeout on all the notifications --- hc/api/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hc/api/models.py b/hc/api/models.py index 8fb48733..7e35b055 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -143,7 +143,7 @@ class Channel(models.Model): "icon_url": "https://healthchecks.io/static/img/logo@2x.png" } - r = requests.post(self.value, json=payload) + r = requests.post(self.value, json=payload, timeout=5) n.status = r.status_code n.save() @@ -155,7 +155,7 @@ class Channel(models.Model): "color": "green" if check.status == "up" else "red", } - r = requests.post(self.value, json=payload) + r = requests.post(self.value, json=payload, timeout=5) n.status = r.status_code n.save() @@ -179,7 +179,7 @@ class Channel(models.Model): } url = "https://events.pagerduty.com/generic/2010-04-15/create_event.json" - r = requests.post(url, data=json.dumps(payload)) + r = requests.post(url, data=json.dumps(payload), timeout=5) n.status = r.status_code n.save()