summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-11-06 10:47:40 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-11-09 12:47:35 +0000
commit4e15a25933f20d16d300d8c14f4d8b1fde7de6b6 (patch)
treed63de877f44d2ce8184cf22dcdf36d517085a494
parent11ec6a72a0c9447b6c5c7635997979f1cf2b1c22 (diff)
downloadnextcloud-server-4e15a25933f20d16d300d8c14f4d8b1fde7de6b6.tar.gz
nextcloud-server-4e15a25933f20d16d300d8c14f4d8b1fde7de6b6.zip
fix(JobList#hasReservedJob): Break tie when multiple jobs are reserved
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
-rw-r--r--lib/private/BackgroundJob/JobList.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index 36cccbd4eab..ae214f69509 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -406,7 +406,7 @@ 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()->gt('reserved_at', $query->createNamedParameter($this->timeFactory->getTime() - 6 * 3600, IQueryBuilder::PARAM_INT)))
->setMaxResults(1);
if ($className !== null) {