You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nextcloud-server/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob...

30 lines
718 B

<?php
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\TaskProcessing;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
class RemoveOldTasksBackgroundJob extends TimedJob {
public function __construct(
ITimeFactory $timeFactory,
private Manager $taskProcessingManager,
) {
parent::__construct($timeFactory);
$this->setInterval(60 * 60 * 24);
// can be deferred to maintenance window
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
/**
* @inheritDoc
*/
protected function run($argument): void {
iterator_to_array($this->taskProcessingManager->cleanupOldTasks());
}
}