f7cloud_client/apps/mail/lib/BackgroundJob/CleanupJob.php
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

37 lines
864 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2020 F7cloud GmbH and F7cloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Mail\BackgroundJob;
use OCA\Mail\Service\CleanupService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use Psr\Log\LoggerInterface;
class CleanupJob extends TimedJob {
private CleanupService $cleanupService;
private LoggerInterface $logger;
public function __construct(ITimeFactory $time,
CleanupService $cleanupService,
LoggerInterface $logger) {
parent::__construct($time);
$this->cleanupService = $cleanupService;
$this->logger = $logger;
$this->setInterval(24 * 60 * 60);
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
#[\Override]
protected function run($argument): void {
$this->cleanupService->cleanUp($this->logger);
}
}