]> source.dussan.org Git - nextcloud-server.git/commitdiff
Update lib/private/BackgroundJob/JobList.php
authorMarcel Klehr <mklehr@gmx.net>
Thu, 20 Apr 2023 11:34:16 +0000 (13:34 +0200)
committerMarcel Klehr <mklehr@gmx.net>
Sun, 23 Apr 2023 10:36:12 +0000 (12:36 +0200)
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
lib/private/BackgroundJob/JobList.php

index 707a8c799045fcdce1296343831fa969437c81d8..d00d219541ea2ed657553a4dd896be16fd393e47 100644 (file)
@@ -388,7 +388,8 @@ class JobList implements IJobList {
                $query = $this->connection->getQueryBuilder();
                $query->select('*')
                        ->from('jobs')
-                       ->where($query->expr()->neq('reserved_at', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)));
+                       ->where($query->expr()->neq('reserved_at', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)))
+                       ->setMaxResults(1);
 
                if ($className !== null) {
                        $query->andWhere($query->expr()->eq('class', $query->createNamedParameter($className)));