Browse Source

[enh] new engine parameter: timeout

asciimoo 11 years ago
parent
commit
5b2680be4b
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      searx/engines/__init__.py

+ 6
- 2
searx/engines/__init__.py View File

@@ -75,8 +75,12 @@ for engine_data in settings['engines']:
75 75
         #engine.language_support = False
76 76
         engine.language_support = True
77 77
 
78
-    if not hasattr(engine, 'shortcut'):
78
+    if not hasattr(engine, 'timeout'):
79 79
         #engine.language_support = False
80
+        engine.timeout = settings['server']['request_timeout']
81
+
82
+    if not hasattr(engine, 'shortcut'):
83
+        #engine.shortcut = '''
80 84
         engine.shortcut = ''
81 85
 
82 86
     # checking required variables
@@ -219,7 +223,7 @@ def search(query, request, selected_engines, pageno=1, lang='all'):
219 223
             headers=request_params['headers'],
220 224
             hooks=dict(response=callback),
221 225
             cookies=request_params['cookies'],
222
-            timeout=settings['server']['request_timeout']
226
+            timeout=engine.timeout
223 227
         )
224 228
 
225 229
         if request_params['method'] == 'GET':