From 1ccd98a3643889c2bb87f84cacdcd3e69bfd6261 Mon Sep 17 00:00:00 2001 From: Chuyen Vo Date: Thu, 17 Mar 2016 12:00:33 +0700 Subject: [PATCH] Update utils.py add timeout requests.request for large zones --- app/lib/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/lib/utils.py b/app/lib/utils.py index 1b838a8..888b4d1 100644 --- a/app/lib/utils.py +++ b/app/lib/utils.py @@ -3,6 +3,9 @@ import sys import json import requests import urlparse +from app import app + +TIMEOUT = app.config['TIMEOUT'] def auth_from_url(url): auth = None @@ -18,7 +21,7 @@ def fetch_remote(remote_url, method='GET', data=None, accept=None, params=None, data = json.dumps(data) if timeout is None: - timeout = 1.5 + timeout = TIMEOUT verify = False @@ -125,4 +128,4 @@ def display_time(amount, units='s', remove_seconds=True): final_string = final_string[:final_string.rfind(' ')] return final_string[:final_string.rfind(' ')] - return final_string \ No newline at end of file + return final_string