MDL-24723 prevent cron execution in CLI maintenance mode
authorPetr Skoda <skodak@moodle.org>
Mon, 18 Oct 2010 12:52:25 +0000 (12:52 +0000)
committerPetr Skoda <skodak@moodle.org>
Mon, 18 Oct 2010 12:52:25 +0000 (12:52 +0000)
lib/cronlib.php

index 02afd37..94d0079 100644 (file)
 function cron_run() {
     global $DB, $CFG, $OUTPUT;
 
 function cron_run() {
     global $DB, $CFG, $OUTPUT;
 
+    if (CLI_MAINTENANCE) {
+        echo "CLI maintenance mode active, cron execution suspended.\n";
+        exit(1);
+    }
+
     require_once($CFG->libdir.'/adminlib.php');
     require_once($CFG->libdir.'/gradelib.php');
 
     require_once($CFG->libdir.'/adminlib.php');
     require_once($CFG->libdir.'/gradelib.php');