mirror of
https://github.com/searxng/searxng.git
synced 2025-07-25 06:09:18 +02:00
search.suspended_time settings: bug fixes
* fix type in settings.yml: replace suspend_times by suspended_times * always use delay defined in settings.yml: * HTTP status 402 and 403: read the value from settings.yml instead of using the hardcoded value of 1 day. * startpage engine: CAPTCHA suspend the engine for one day instead of one week
This commit is contained in:
parent
6b71721ce8
commit
37addec69e
4 changed files with 11 additions and 7 deletions
|
@ -72,9 +72,7 @@ def raise_for_httperror(resp):
|
|||
if resp.status_code and resp.status_code >= 400:
|
||||
raise_for_captcha(resp)
|
||||
if resp.status_code in (402, 403):
|
||||
raise SearxEngineAccessDeniedException(
|
||||
message='HTTP error ' + str(resp.status_code), suspended_time=3600 * 24
|
||||
)
|
||||
raise SearxEngineAccessDeniedException(message='HTTP error ' + str(resp.status_code))
|
||||
if resp.status_code == 429:
|
||||
raise SearxEngineTooManyRequestsException()
|
||||
resp.raise_for_status()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue