Skip to content
Snippets Groups Projects
Commit 3a7a829d authored by Laurent's avatar Laurent
Browse files

Merge branch 'hotline#146510_autocompletion_limiter_le_temps_pris_par_grep_sort_a_1s' into 'master'

hotline #146510 Limit execution time of grep/sort to 1s

See merge request !4309
parents 22465524 ecd04281
Branches
Tags
1 merge request!4309hotline #146510 Limit execution time of grep/sort to 1s
Pipeline #15660 passed with stage
in 26 minutes and 59 seconds
- ticket #146510 : Autocompletion : limitation du temps maximum de réponse à 1s
\ No newline at end of file
......@@ -68,7 +68,7 @@ class Class_Autocomplete_IndexSearcher {
$grep_args []= "-i -E '(\b|'\'')" . $term . "'";
$grep_args[] = "-m 10 ".array_pop($grep_args);
return 'grep '.implode(' | grep ', $grep_args);
return 'timeout 1s grep '.implode(' | grep ', $grep_args);
}
......
......@@ -138,7 +138,7 @@ class BokehEcoSuggestAjaxActionTest extends BokehEngineEcoTestCase {
/** @test */
public function grepCommandForIleMaiteShouldRestrictLastResultToTen() {
$this->assertEquals(
"grep -riI -E --no-filename '(\b|'\'')M[aàáâãäå][iìíîï]t[eèéêë][eèéêë]' | sort -Vuf | grep -i -E '(\b|'\'')l'\''[iìíîï]l[eèéêë]' | grep -i -E '(\b|'\'')[iìíîï]l[eèéêë]' | grep -m 10 -i -E '(\b|'\'')d[eèéêë]'",
"timeout 1s grep -riI -E --no-filename '(\b|'\'')M[aàáâãäå][iìíîï]t[eèéêë][eèéêë]' | sort -Vuf | grep -i -E '(\b|'\'')l'\''[iìíîï]l[eèéêë]' | grep -i -E '(\b|'\'')[iìíîï]l[eèéêë]' | grep -m 10 -i -E '(\b|'\'')d[eèéêë]'",
(new Class_Autocomplete_IndexSearcher)->buildGrepCommand("l'ile dE Maitee"));
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment