From 31105b8c8627c5318d38333a4d317b1cd996a67a Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 8 Aug 2017 13:24:16 +0200 Subject: [PATCH] [fix] timeout on request to avoid blocking process --- src/yunohost/dyndns.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yunohost/dyndns.py b/src/yunohost/dyndns.py index 27aeedd31..593c765e6 100644 --- a/src/yunohost/dyndns.py +++ b/src/yunohost/dyndns.py @@ -184,11 +184,14 @@ def dyndns_update(dyn_host="dyndns.yunohost.org", domain=None, key=None, try: # Check if domain is registered if requests.get('https://{0}/test/{1}'.format( - dyn_host, _domain)).status_code == 200: + dyn_host, _domain), timeout=30).status_code == 200: continue except requests.ConnectionError: raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection')) + except requests.exceptions.Timeout: + logger.warning("Correction timed out on {}, skip it".format( + 'https://{0}/test/{1}'.format(dyn_host, _domain))) domain = _domain key = path break