[BUGFIX] Execute scheduler tasks ordered by next execution time
[Packages/TYPO3.CMS.git] / typo3 / sysext / scheduler / Classes / Scheduler.php
index 2905bce..460ad08 100644 (file)
@@ -325,6 +325,7 @@ class Scheduler implements SingletonInterface, LoggerAwareInterface
                 ),
                 $queryBuilder->expr()->eq('t.deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
             );
+            $queryBuilder->orderBy('t.nextexecution', 'ASC');
         } else {
             $queryBuilder->where(
                 $queryBuilder->expr()->eq('t.uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)),