2021-03-12 05:20:04 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2021-06-04 15:52:51 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2021-03-12 05:20:04 -05:00
|
|
|
*/
|
|
|
|
|
namespace OCA\DAV\BackgroundJob;
|
|
|
|
|
|
|
|
|
|
use OCA\DAV\CalDAV\RetentionService;
|
|
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
|
|
|
use OCP\BackgroundJob\TimedJob;
|
|
|
|
|
|
|
|
|
|
class CalendarRetentionJob extends TimedJob {
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
ITimeFactory $time,
|
|
|
|
|
private RetentionService $service,
|
|
|
|
|
) {
|
2021-03-12 05:20:04 -05:00
|
|
|
parent::__construct($time);
|
|
|
|
|
|
|
|
|
|
// Run four times a day
|
|
|
|
|
$this->setInterval(6 * 60 * 60);
|
2022-02-22 05:24:38 -05:00
|
|
|
$this->setTimeSensitivity(self::TIME_SENSITIVE);
|
2021-03-12 05:20:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function run($argument): void {
|
|
|
|
|
$this->service->cleanUp();
|
|
|
|
|
}
|
|
|
|
|
}
|