From 5b2680be4b76db8da47f5bb8d8bc47fd21bb5ae5 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Thu, 13 Feb 2014 17:08:22 +0100 Subject: [PATCH] [enh] new engine parameter: timeout --- searx/engines/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index b2750d0c2..61d388627 100644 --- 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':