Browse files

enhance cron response when disabled.

  • Loading branch information...
1 parent 1bf5043 commit 07c0c46facb0b9b44847100baf57bd831feb2261 diml committed Sep 7, 2007
Showing with 28 additions and 31 deletions.
  1. +28 −31 search/cron.php
View
59 search/cron.php
@@ -1,35 +1,32 @@
<?php
- /* cron script to perform all the periodic search tasks
- *
- * delete.php
- * updates the index by pruning deleted documents
- *
- * update.php
- * updates document info in the index if the document has been modified since indexing
- *
- * add.php
- * adds documents created since the last index run
- */
+/* cron script to perform all the periodic search tasks
+*
+* delete.php
+* updates the index by pruning deleted documents
+*
+* update.php
+* updates document info in the index if the document has been modified since indexing
+*
+* add.php
+* adds documents created since the last index run
+*/
- require_once('../config.php');
- require_once("$CFG->dirroot/search/lib.php");
+ require_once('../config.php');
+ require_once("$CFG->dirroot/search/lib.php");
- if (empty($CFG->enableglobalsearch)) {
- mtrace('Global searching is not enabled.');
- return;
- }
-
- mtrace("<pre>Starting cron...\n");
-
- mtrace("--DELETE----");
- require_once("$CFG->dirroot/search/delete.php");
- mtrace("--UPDATE----");
- require_once("$CFG->dirroot/search/update.php");
- mtrace("--ADD-------");
- require_once("$CFG->dirroot/search/add.php");
- mtrace("------------");
-
- mtrace("cron finished.</pre>");
-
-?>
+ if (empty($CFG->enableglobalsearch)) {
+ mtrace('Global searching is not enabled. Nothing performed by search.');
+ }
+ else{
+ mtrace("<pre>Starting cron...\n");
+ mtrace("--DELETE----");
+ require_once("$CFG->dirroot/search/delete.php");
+ mtrace("--UPDATE----");
+ require_once("$CFG->dirroot/search/update.php");
+ mtrace("--ADD-------");
+ require_once("$CFG->dirroot/search/add.php");
+ mtrace("------------");
+ mtrace("cron finished.</pre>");
+ }
+?>

0 comments on commit 07c0c46

Please sign in to comment.