]> git.mjollnir.org Git - moodle.git/commitdiff
Solve one issue with skipped courses and email to admin
authorstronk7 <stronk7>
Wed, 7 Jun 2006 22:22:21 +0000 (22:22 +0000)
committerstronk7 <stronk7>
Wed, 7 Jun 2006 22:22:21 +0000 (22:22 +0000)
being set every xx minutes. Bug 5621.
(http://moodle.org/bugs/bug.php?op=show&bugid=5621)

Merged from MOODLE_16_STABLE

backup/backup_scheduled.php

index e6ebd5664f76a0132acd939c3ef9dc6636d4e6d7..8af3c16dd9d6df8ed012498ce64b2a9ecebfe065 100644 (file)
@@ -100,16 +100,17 @@ function schedule_backup_cron() {
                     $status = false;
                     continue;
                 }
-                //Now we backup every course with nextstarttime < now
-                if ($backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {
+                // Skip backup of unavailable courses that have remained unmodified in a month
+                $skipped = false;
+                if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) {  //Hidden + unmodified last month
+                    mtrace("            SKIPPING - hidden+unmodified");
+                    set_field("backup_courses","laststatus","3","courseid",$backup_course->courseid);
+                    $skipped = true;
+                } 
+                //Now we backup every non skipped course with nextstarttime < now
+                if (!$skipped  && $backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {
                     //We have to send a email because we have included at least one backup
                     $emailpending = true;
-                    // Skip backup of unavailable courses that have remained unmodified in a month
-                    if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) {  //Hidden + unmodified last month
-                         mtrace("            SKIPPING - hidden+unmodified");
-                         set_field("backup_courses","laststatus","3","courseid",$backup_course->courseid);
-                         continue;
-                    }
                     //Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error)
                     if ($backup_course->laststatus != 2) {
                         //Set laststarttime