diff --git a/uptime/check/check.py b/uptime/check/check.py index 530157a..d8bc1a2 100644 --- a/uptime/check/check.py +++ b/uptime/check/check.py @@ -9,9 +9,9 @@ from requests import get, post from config import HC_ROOT, CONFIG -def check_domain(domain): +def check_domain(domain, timeout): try: - r = get('https://%s' % domain, timeout=6) + r = get('https://%s' % domain, timeout=timeout) except Exception as e: return (e, 0) return (r.status_code, r.elapsed) @@ -29,7 +29,7 @@ for check_item in CONFIG: fail = False data = [] for domain in check_item['domains']: - (status, timed) = check_domain(domain) + (status, timed) = check_domain(domain, check_item.get('timeout', 9)) if not fail and status != 200: fail = True if isinstance(status, Exception):