From 75a13f2620bc46da881222012e75334c587bfb5f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 21 Apr 2023 10:34:24 +0200 Subject: [PATCH] JobList#hasReservedJobs: Close cursor so Joas doesn't die Signed-off-by: Marcel Klehr --- lib/private/BackgroundJob/JobList.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php index 638919d4c3927..3846aed3d61ba 100644 --- a/lib/private/BackgroundJob/JobList.php +++ b/lib/private/BackgroundJob/JobList.php @@ -397,7 +397,9 @@ public function hasReservedJob(?string $className = null): bool { try { $result = $query->executeQuery(); - return count($result->fetchAll()) > 0; + $hasReservedJobs = $result->fetch() !== false; + $result->closeCursor(); + return $hasReservedJobs; } catch (Exception $e) { return false; }