MDL-68433 tasks: Limit the adhoc task queue look ahead

This commit is contained in:
Brendan Heywood 2020-04-16 23:33:07 +10:00
parent df0e58adb1
commit 611d6c1e29

View File

@ -568,8 +568,7 @@ class manager {
$where = '(nextruntime IS NULL OR nextruntime < :timestart1)';
$params = array('timestart1' => $timestart);
$records = $DB->get_records_select('task_adhoc', $where, $params, 'nextruntime ASC, id ASC');
$records = $DB->get_records_select('task_adhoc', $where, $params, 'nextruntime ASC, id ASC', '*', 0, 2000);
$records = self::ensure_adhoc_task_qos($records);
$cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');