mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 05:54:19 +02:00
Merge branch 'MDL-73801' of https://github.com/paulholden/moodle
This commit is contained in:
commit
be4352bd3e
@ -77,6 +77,7 @@ abstract class backup_cron_automated_helper {
|
||||
* First backup courses that do not have an entry in backup_courses first,
|
||||
* as they are likely new and never been backed up. Do the oldest modified courses first.
|
||||
* Then backup courses that have previously been backed up starting with the oldest next start time.
|
||||
* Finally, all else being equal, defer to the sortorder of the courses.
|
||||
*
|
||||
* @param null|int $now timestamp to use in course selection.
|
||||
* @return moodle_recordset The recordset of matching courses.
|
||||
@ -93,7 +94,8 @@ abstract class backup_cron_automated_helper {
|
||||
LEFT JOIN {backup_courses} bc ON bc.courseid = c.id
|
||||
WHERE bc.nextstarttime IS NULL OR bc.nextstarttime < ?
|
||||
ORDER BY nextstarttime ASC,
|
||||
c.timemodified DESC';
|
||||
c.timemodified DESC,
|
||||
c.sortorder';
|
||||
|
||||
$params = array(
|
||||
$now, // Only get courses where the backup start time is in the past.
|
||||
|
@ -393,7 +393,7 @@ class cronhelper_test extends \advanced_testcase {
|
||||
$backupcourse3 = new \stdClass;
|
||||
$backupcourse3->courseid = $course3->id;
|
||||
$backupcourse3->laststatus = testable_backup_cron_automated_helper::BACKUP_STATUS_OK;
|
||||
$backupcourse3->nextstarttime = 1554858160;
|
||||
$backupcourse3->nextstarttime = 1554822160;
|
||||
$DB->insert_record('backup_courses', $backupcourse3);
|
||||
|
||||
$backupcourse4 = new \stdClass;
|
||||
|
Loading…
x
Reference in New Issue
Block a user