Solve one issue with skipped courses and email to admin

being set every xx minutes. Bug 5621.
(http://moodle.org/bugs/bug.php?op=show&bugid=5621)
This commit is contained in:
stronk7
2006-06-07 22:17:31 +00:00
parent dd9a68560e
commit cdb048acd7
+9 -8
View 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