MDL-24726 prevent cron execution when upgrade pending
authorPetr Skoda <skodak@moodle.org>
Mon, 18 Oct 2010 17:06:44 +0000 (17:06 +0000)
committerPetr Skoda <skodak@moodle.org>
Mon, 18 Oct 2010 17:06:44 +0000 (17:06 +0000)
lib/cronlib.php

index 94d0079..ceacba3 100644 (file)
@@ -32,6 +32,11 @@ function cron_run() {
         exit(1);
     }
 
+    if (moodle_needs_upgrading()) {
+        echo "Moodle upgrade pending, cron execution suspended.\n";
+        exit(1);
+    }
+
     require_once($CFG->libdir.'/adminlib.php');
     require_once($CFG->libdir.'/gradelib.php');