aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2024-07-23 11:06:42 +0200
committerJulien Veyssier <julien-nc@posteo.net>2024-07-23 17:12:38 +0200
commitdf11aa9efc21895cba716dd23eb71969e8532393 (patch)
treee4b1f3a76152703cffe3a467235193fd628c2def /core
parentaf21f7dbd9e377d7c057e49ec983f8e9a5a8cc06 (diff)
downloadnextcloud-server-df11aa9efc21895cba716dd23eb71969e8532393.tar.gz
nextcloud-server-df11aa9efc21895cba716dd23eb71969e8532393.zip
feat(taskprocessing): add appId filter to taskprocessing occ commands
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'core')
-rw-r--r--core/Command/TaskProcessing/ListCommand.php9
-rw-r--r--core/Command/TaskProcessing/Statistics.php9
2 files changed, 16 insertions, 2 deletions
diff --git a/core/Command/TaskProcessing/ListCommand.php b/core/Command/TaskProcessing/ListCommand.php
index 92897c8b9ea..46f32e0bc53 100644
--- a/core/Command/TaskProcessing/ListCommand.php
+++ b/core/Command/TaskProcessing/ListCommand.php
@@ -36,6 +36,12 @@ class ListCommand extends Base {
'only get the tasks for one task type'
)
->addOption(
+ 'appId',
+ null,
+ InputOption::VALUE_OPTIONAL,
+ 'only get the tasks for one app ID'
+ )
+ ->addOption(
'customId',
null,
InputOption::VALUE_OPTIONAL,
@@ -70,12 +76,13 @@ class ListCommand extends Base {
$userIdFilter = null;
}
$type = $input->getOption('type');
+ $appId = $input->getOption('appId');
$customId = $input->getOption('customId');
$status = $input->getOption('status');
$scheduledAfter = $input->getOption('scheduledAfter');
$endedBefore = $input->getOption('endedBefore');
- $tasks = $this->taskProcessingManager->getTasks($userIdFilter, $type, $customId, $status, $scheduledAfter, $endedBefore);
+ $tasks = $this->taskProcessingManager->getTasks($userIdFilter, $type, $appId, $customId, $status, $scheduledAfter, $endedBefore);
$arrayTasks = array_map(fn (Task $task): array => $task->jsonSerialize(), $tasks);
$this->writeArrayInOutputFormat($input, $output, $arrayTasks);
diff --git a/core/Command/TaskProcessing/Statistics.php b/core/Command/TaskProcessing/Statistics.php
index 13a4c93d036..a3dc9ee0254 100644
--- a/core/Command/TaskProcessing/Statistics.php
+++ b/core/Command/TaskProcessing/Statistics.php
@@ -36,6 +36,12 @@ class Statistics extends Base {
'only get the tasks for one task type'
)
->addOption(
+ 'appId',
+ null,
+ InputOption::VALUE_OPTIONAL,
+ 'only get the tasks for one app ID'
+ )
+ ->addOption(
'customId',
null,
InputOption::VALUE_OPTIONAL,
@@ -70,12 +76,13 @@ class Statistics extends Base {
$userIdFilter = null;
}
$type = $input->getOption('type');
+ $appId = $input->getOption('appId');
$customId = $input->getOption('customId');
$status = $input->getOption('status');
$scheduledAfter = $input->getOption('scheduledAfter');
$endedBefore = $input->getOption('endedBefore');
- $tasks = $this->taskProcessingManager->getTasks($userIdFilter, $type, $customId, $status, $scheduledAfter, $endedBefore);
+ $tasks = $this->taskProcessingManager->getTasks($userIdFilter, $type, $appId, $customId, $status, $scheduledAfter, $endedBefore);
$stats = ['Number of tasks' => count($tasks)];