forked from GithubBackups/healthchecks
timeout on all the notifications
This commit is contained in:
parent
de203275c6
commit
93c71ad10e
@ -143,7 +143,7 @@ class Channel(models.Model):
|
|||||||
"icon_url": "https://healthchecks.io/static/img/logo@2x.png"
|
"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.status = r.status_code
|
||||||
n.save()
|
n.save()
|
||||||
@ -155,7 +155,7 @@ class Channel(models.Model):
|
|||||||
"color": "green" if check.status == "up" else "red",
|
"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.status = r.status_code
|
||||||
n.save()
|
n.save()
|
||||||
@ -179,7 +179,7 @@ class Channel(models.Model):
|
|||||||
}
|
}
|
||||||
|
|
||||||
url = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
|
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.status = r.status_code
|
||||||
n.save()
|
n.save()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user