Skip to content

Commit 5abda7e

Browse files
Simplify logic for when the check is added
1 parent 844bd5b commit 5abda7e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ function search_elastic_extend_navigation_user() {
6363
function search_elastic_status_checks(): array {
6464
// If elastic isn't the selected engine or global search is off, do not register the check at all.
6565
if (
66-
!\core_search\manager::is_global_search_enabled() ||
67-
(isset($CFG->searchengine) && $CFG->searchengine !== 'elastic')
66+
\core_search\manager::is_global_search_enabled() &&
67+
isset($CFG->searchengine) &&
68+
$CFG->searchengine == 'elastic'
6869
) {
69-
return [];
70+
return [new \search_elastic\check\server_ready_check()];
7071
}
71-
return [new \search_elastic\check\server_ready_check()];
72+
return [];
7273
}

0 commit comments

Comments
 (0)