diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index b7fd89c9054..fdf4e3eb96f 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -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');