mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[enh] Add timeout limit per request (#1640)
The new url parameter "timeout_limit" set timeout limit defined in second. Example "timeout_limit=1.5" means the timeout limit is 1.5 seconds. In addition, the query can start with <[number] to set the timeout limit. For number between 0 and 99, the unit is the second : Example: "<30 searx" means the timeout limit is 3 seconds For number above 100, the unit is the millisecond: Example: "<850 searx" means the timeout is 850 milliseconds. In addition, there is a new optional setting: outgoing.max_request_timeout. If not set, the user timeout can't go above searx configuration (as before: the max timeout of selected engine for a query). If the value is set, the user can set a timeout between 0 and max_request_timeout using <[number] or timeout_limit query parameter. Related to #1077 Updated version of PR #1413 from @isj-privacore
This commit is contained in:
parent
2179079a91
commit
72029d27de
10 changed files with 180 additions and 15 deletions
|
|
@ -5,6 +5,7 @@
|
|||
<input type="hidden" name="pageno" value="{{ pageno }}" />
|
||||
<input type="hidden" name="time_range" value="{{ time_range }}" />
|
||||
<input type="hidden" name="language" value="{{ current_language }}" />
|
||||
<input type="hidden" name="timeout_limit" value="{{ timeout_limit }}" />
|
||||
{%- endmacro %}
|
||||
{%- macro search_url() %}{{ base_url }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&language={{ current_language }}{% endif %}{% endmacro -%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue