MDL-47480 tasks: Define order for getting tasks

This commit is contained in:
Ankit Agarwal
2015-06-02 08:18:13 +05:30
parent dc7b914677
commit 6dbe2aaacb
2 changed files with 29 additions and 1 deletions
+2 -1
View File
@@ -448,7 +448,8 @@ class manager {
$where = "(lastruntime IS NULL OR lastruntime < :timestart1)
AND (nextruntime IS NULL OR nextruntime < :timestart2)
AND disabled = 0";
AND disabled = 0
ORDER BY lastruntime, id ASC";
$params = array('timestart1' => $timestart, 'timestart2' => $timestart);
$records = $DB->get_records_select('task_scheduled', $where, $params);