Merge branch 'MDL-59039-master' of https://github.com/sammarshallou/moodle

This commit is contained in:
David Monllao 2017-07-11 21:49:03 +02:00
commit afabbd110e
13 changed files with 302 additions and 36 deletions

View file

@ -46,12 +46,13 @@ class search_index_task extends scheduled_task {
* Throw exceptions on errors (the job will be retried).
*/
public function execute() {
if (!\core_search\manager::is_global_search_enabled()) {
if (!\core_search\manager::is_global_search_enabled() &&
!get_config('core', 'searchindexwhendisabled')) {
return;
}
$globalsearch = \core_search\manager::instance();
// Indexing database records for modules + rich documents of forum.
$globalsearch->index();
$globalsearch->index(false, get_config('core', 'searchindextime'), new \text_progress_trace());
}
}

View file

@ -49,7 +49,8 @@ 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()) {
if (!\core_search\manager::is_global_search_enabled() &&
!get_config('core', 'searchindexwhendisabled')) {
return;
}