diff options
author | asciimoo <asciimoo@gmail.com> | 2014-02-13 17:08:22 +0100 |
---|---|---|
committer | asciimoo <asciimoo@gmail.com> | 2014-02-13 17:08:22 +0100 |
commit | 5b2680be4b76db8da47f5bb8d8bc47fd21bb5ae5 (patch) | |
tree | 2ce0cd95bbaa70a0508365f4d0343d733c935c2b | |
parent | c1d7d30b8ec2950a6338f0b99ebe9bdc094fdb73 (diff) | |
download | searxng-5b2680be4b76db8da47f5bb8d8bc47fd21bb5ae5.tar.gz searxng-5b2680be4b76db8da47f5bb8d8bc47fd21bb5ae5.zip |
[enh] new engine parameter: timeout
-rw-r--r-- | searx/engines/__init__.py | 8 |
1 files 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': |