aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/BackgroundJob
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-04-20 13:34:16 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-04-23 12:36:12 +0200
commit6f9a3218d02ca857e0ade4658fc371193e91dd52 (patch)
treef4a4cd7046a2356b9ca2d43be667864700dfaeda /lib/private/BackgroundJob
parent56cb5d1d13d5402a2281722bd82454e8c39e3107 (diff)
downloadnextcloud-server-6f9a3218d02ca857e0ade4658fc371193e91dd52.tar.gz
nextcloud-server-6f9a3218d02ca857e0ade4658fc371193e91dd52.zip
Update lib/private/BackgroundJob/JobList.php
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private/BackgroundJob')
-rw-r--r--lib/private/BackgroundJob/JobList.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index 707a8c79904..d00d219541e 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -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)));