aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/BackgroundJob/JobList.php5
-rw-r--r--lib/public/BackgroundJob/IJobList.php12
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index 36f46d7bad7..9d54fa45bfc 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -448,11 +448,14 @@ class JobList implements IJobList {
$result = $query->executeQuery();
$jobs = [];
+
while (($row = $result->fetch()) !== false) {
+ /**
+ * @var array{count:int, class:class-string} $row
+ */
$jobs[] = $row;
}
return $jobs;
-
}
}
diff --git a/lib/public/BackgroundJob/IJobList.php b/lib/public/BackgroundJob/IJobList.php
index 07b5ebcf48b..e2e9eca9415 100644
--- a/lib/public/BackgroundJob/IJobList.php
+++ b/lib/public/BackgroundJob/IJobList.php
@@ -110,9 +110,9 @@ interface IJobList {
/**
* get the next job in the list
*
- * @since 7.0.0 - In 24.0.0 parameter $onlyTimeSensitive got added
+ * @since 7.0.0 - In 24.0.0 parameter $onlyTimeSensitive got added; In 29.0.0 parameter $jobClass got added
*/
- public function getNext(bool $onlyTimeSensitive = false): ?IJob;
+ public function getNext(bool $onlyTimeSensitive = false, string $jobClass = null): ?IJob;
/**
* @since 7.0.0
@@ -168,4 +168,12 @@ interface IJobList {
* @since 27.0.0
*/
public function hasReservedJob(?string $className): bool;
+
+ /**
+ * Returns a count of jobs per Job class
+ *
+ * @return list<array{class:class-string, count:int}>
+ * @since 29.0.0
+ */
+ public function countByClass(): array;
}