mirror of
https://github.com/searxng/searxng.git
synced 2025-12-22 19:50:00 +00:00
[fix] engines - set hard timouts in *sub-request* (#5460)
The requests changed here all run outside of the network context timeout, thereby preventing the engine's timeout from being applied (the engine's timeout can become longer than it was configured). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
@@ -64,7 +64,7 @@ def _get_algolia_api_url():
|
||||
return __CACHED_API_URL
|
||||
|
||||
# fake request to extract api url
|
||||
resp = get(f"{pdia_base_url}/search/?q=")
|
||||
resp = get(f"{pdia_base_url}/search/?q=", timeout=3)
|
||||
if resp.status_code != 200:
|
||||
raise LookupError("Failed to fetch config location (and as such the API url) for PDImageArchive")
|
||||
pdia_config_filepart = extr(resp.text, pdia_config_start, pdia_config_end)
|
||||
|
||||
Reference in New Issue
Block a user