summaryrefslogtreecommitdiffstats
path: root/lib/private/BackgroundJob
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/BackgroundJob')
-rw-r--r--lib/private/BackgroundJob/JobList.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index 638919d4c39..3846aed3d61 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -397,7 +397,9 @@ class JobList implements IJobList {
try {
$result = $query->executeQuery();
- return count($result->fetchAll()) > 0;
+ $hasReservedJobs = $result->fetch() !== false;
+ $result->closeCursor();
+ return $hasReservedJobs;
} catch (Exception $e) {
return false;
}