Skip to content
Browse files

let lethal exceptions from Lucene passthrough and the cron script fin…

…ish normally
  • Loading branch information...
1 parent 15999a9 commit 7d0b446a6c9a3f4a4aed818edd300be35b1f4faa diml committed
Showing with 20 additions and 10 deletions.
  1. +20 −10 search/cron.php
View
30 search/cron.php
@@ -15,18 +15,28 @@
require_once('../config.php');
require_once("$CFG->dirroot/search/lib.php");
- if (empty($CFG->enableglobalsearch)) {
+ if (!search_check_php5()) {
+ $phpversion = phpversion();
+ mtrace("Sorry, cannot cron global search as it requires PHP 5.0.0 or later (currently using version $phpversion)");
+ }
+ else 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>");
+ try{
+ 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>");
+ }
+ catch(Exception $ex){
+ mtrace('Fatal exception from Lucene subsystem. Search engine may not have been updated.');
+ mtrace($ex);
+ }
}
?>

0 comments on commit 7d0b446

Please sign in to comment.
Something went wrong with that request. Please try again.