commit: 5b2680be4b76db8da47f5bb8d8bc47fd21bb5ae5
parent: c1d7d30b8ec2950a6338f0b99ebe9bdc094fdb73
Author: asciimoo <asciimoo@gmail.com>
Date: Thu, 13 Feb 2014 17:08:22 +0100
[enh] new engine parameter: timeout
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py
@@ -75,8 +75,12 @@ for engine_data in settings['engines']:
#engine.language_support = False
engine.language_support = True
- if not hasattr(engine, 'shortcut'):
+ if not hasattr(engine, 'timeout'):
#engine.language_support = False
+ engine.timeout = settings['server']['request_timeout']
+
+ if not hasattr(engine, 'shortcut'):
+ #engine.shortcut = '''
engine.shortcut = ''
# checking required variables
@@ -219,7 +223,7 @@ def search(query, request, selected_engines, pageno=1, lang='all'):
headers=request_params['headers'],
hooks=dict(response=callback),
cookies=request_params['cookies'],
- timeout=settings['server']['request_timeout']
+ timeout=engine.timeout
)
if request_params['method'] == 'GET':