summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-04-10 00:59:25 +0200
committerAdam Tauber <asciimoo@gmail.com>2015-04-10 00:59:25 +0200
commit9d11b36b5bc62fd94f77e4d0f5119b4f8cb22fa3 (patch)
tree03487a06da4f3806eeeea819442685e2853f1a30
parent6f73f4e7a41b957bf74494613d035f9140f5f906 (diff)
downloadsearxng-9d11b36b5bc62fd94f77e4d0f5119b4f8cb22fa3.tar.gz
searxng-9d11b36b5bc62fd94f77e4d0f5119b4f8cb22fa3.zip
[fix] timeout to autocompleters
-rw-r--r--searx/autocomplete.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/searx/autocomplete.py b/searx/autocomplete.py
index 9d31aa36f..83e204890 100644
--- a/searx/autocomplete.py
+++ b/searx/autocomplete.py
@@ -19,11 +19,19 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
from lxml import etree
from json import loads
from urllib import urlencode
+from searx import settings
from searx.languages import language_codes
from searx.engines import (
categories, engines, engine_shortcuts
)
-from searx.poolrequests import get
+from searx.poolrequests import get as http_get
+
+
+def get(*args, **kwargs):
+ if not 'timeout' in kwargs:
+ kwargs['timeout'] = settings['server']['request_timeout']
+
+ return http_get(*args, **kwargs)
def searx_bang(full_query):