MDL-55356 core_search: API to check if indexing enabled

New function \core_search\manager::is_indexing_enabled(), analagous
to existing is_global_search_enabled().

This replaces existing duplicated code, ready for more use in
following commits.
This commit is contained in:
sam marshall
2017-10-11 17:17:06 +01:00
parent 0da8f62f3b
commit d761b3fb19
3 changed files with 13 additions and 4 deletions
+1 -2
View File
@@ -49,8 +49,7 @@ class search_optimize_task extends scheduled_task {
* Throw exceptions on errors (the job will be retried).
*/
public function execute() {
if (!\core_search\manager::is_global_search_enabled() &&
!get_config('core', 'searchindexwhendisabled')) {
if (!\core_search\manager::is_indexing_enabled()) {
return;
}