mirror of https://github.com/searxng/searxng.git
[enh] request timeout added
This commit is contained in:
parent
c3c9d147ce
commit
a8797839a1
|
@ -123,6 +123,7 @@ def search(query, request, selected_categories):
|
||||||
,headers = request_params['headers']
|
,headers = request_params['headers']
|
||||||
,hooks = dict(response=callback)
|
,hooks = dict(response=callback)
|
||||||
,cookies = request_params['cookies']
|
,cookies = request_params['cookies']
|
||||||
|
,timeout = settings.timeout
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
req = grequests.post(request_params['url']
|
req = grequests.post(request_params['url']
|
||||||
|
@ -130,6 +131,7 @@ def search(query, request, selected_categories):
|
||||||
,headers = request_params['headers']
|
,headers = request_params['headers']
|
||||||
,hooks = dict(response=callback)
|
,hooks = dict(response=callback)
|
||||||
,cookies = request_params['cookies']
|
,cookies = request_params['cookies']
|
||||||
|
,timeout = settings.timeout
|
||||||
)
|
)
|
||||||
requests.append(req)
|
requests.append(req)
|
||||||
grequests.map(requests)
|
grequests.map(requests)
|
||||||
|
|
|
@ -3,7 +3,9 @@ port = 8888
|
||||||
|
|
||||||
secret_key = "ultrasecretkey" # change this!
|
secret_key = "ultrasecretkey" # change this!
|
||||||
|
|
||||||
debug = False
|
debug = True
|
||||||
|
|
||||||
|
request_timeout = 5.0 # seconds
|
||||||
|
|
||||||
weights = {} # 'search_engine_name': float(weight) | default is 1.0
|
weights = {} # 'search_engine_name': float(weight) | default is 1.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue