[BUGFIX] Execute scheduler tasks ordered by next execution time 06/58806/2
authorSascha Egerer <sascha@sascha-egerer.de>
Tue, 30 Oct 2018 09:52:04 +0000 (10:52 +0100)
committerBenni Mack <benni@typo3.org>
Tue, 30 Oct 2018 21:23:04 +0000 (22:23 +0100)
When executing scheduler tasks the next execution time of the task
should be used to define the execution order.

Resolves: #86795
Releases: master, 8.7
Change-Id: Id678c74a60491aa3c8be8a33534b71ac37245217
Reviewed-on: https://review.typo3.org/58806
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/scheduler/Classes/Scheduler.php

index 954f98a..a9387ef 100644 (file)
@@ -332,6 +332,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface
                     $queryBuilder->expr()->isNull('g.hidden')
                 )
             );
+            $queryBuilder->orderBy('t.nextexecution', 'ASC');
         } else {
             $queryBuilder->where(
                 $queryBuilder->expr()->eq('t.uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))