Skip to content

Commit e533954

Browse files
Merge pull request #57641 from nextcloud/fix/taskprocessing-cli-cast
fix(TaskProcessing): Fix occ commands to cast strings to integer
2 parents 772471d + 1f12126 commit e533954

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/Command/TaskProcessing/Cleanup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure() {
4646
}
4747

4848
protected function execute(InputInterface $input, OutputInterface $output): int {
49-
$maxAgeSeconds = $input->getArgument('maxAgeSeconds') ?? Manager::MAX_TASK_AGE_SECONDS;
49+
$maxAgeSeconds = (int)($input->getArgument('maxAgeSeconds') ?? Manager::MAX_TASK_AGE_SECONDS);
5050
$output->writeln('<comment>Cleanup up tasks older than ' . $maxAgeSeconds . ' seconds and the related output files</comment>');
5151

5252
$taskIdsToCleanup = [];

core/Command/TaskProcessing/Statistics.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8181
$type = $input->getOption('type');
8282
$appId = $input->getOption('appId');
8383
$customId = $input->getOption('customId');
84-
$status = $input->getOption('status');
85-
$scheduledAfter = $input->getOption('scheduledAfter');
86-
$endedBefore = $input->getOption('endedBefore');
84+
$status = $input->getOption('status') !== null ? (int)$input->getOption('status') : null;
85+
$scheduledAfter = $input->getOption('scheduledAfter') !== null ? (int)$input->getOption('scheduledAfter') : null;
86+
$endedBefore = $input->getOption('endedBefore') !== null ? (int)$input->getOption('endedBefore') : null;
8787

8888
$tasks = $this->taskProcessingManager->getTasks($userIdFilter, $type, $appId, $customId, $status, $scheduledAfter, $endedBefore);
8989

0 commit comments

Comments
 (0)