FEATURE: when under extreme load disable search

The global setting disable_search_queue_threshold
(DISCOURSE_DISABLE_SEARCH_QUEUE_THRESHOLD) which default to 1 second was
added.

This protection ensures that when the application is unable to keep up with
requests it will simply turn off search till it is not backed up.

To disable this protection set this to 0.
This commit is contained in:
Sam Saffron
2019-07-02 11:22:01 +10:00
parent dc5eb76551
commit 4dcc5f16f1
9 changed files with 125 additions and 27 deletions
@@ -125,6 +125,12 @@
{{#if searchActive}}
<h3>{{i18n "search.no_results"}}</h3>
{{#if model.grouped_search_result.error}}
<div class="warning">
{{model.grouped_search_result.error}}
</div>
{{/if}}
{{#if showSuggestion}}
<div class="no-results-suggestion">
{{i18n "search.cant_find"}}
@@ -1,3 +1,4 @@
import { popupAjaxError } from "discourse/lib/ajax-error";
import { searchForTerm, isValidSearchTerm } from "discourse/lib/search";
import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
@@ -78,6 +79,7 @@ const SearchHelper = {
searchData.topicId = null;
}
})
.catch(popupAjaxError)
.finally(() => {
searchData.loading = false;
widget.scheduleRerender();