2023-07-31 19:10:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
2024-05-29 09:32:54 +00:00
|
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-07-31 19:10:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCA\FilesReminders\BackgroundJob;
|
|
|
|
|
|
|
|
use OCA\FilesReminders\Service\ReminderService;
|
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
|
|
use OCP\BackgroundJob\TimedJob;
|
|
|
|
|
|
|
|
class CleanUpReminders extends TimedJob {
|
|
|
|
public function __construct(
|
2023-07-31 23:49:42 +00:00
|
|
|
ITimeFactory $time,
|
2023-07-31 19:10:50 +00:00
|
|
|
private ReminderService $reminderService,
|
|
|
|
) {
|
|
|
|
parent::__construct($time);
|
2023-07-31 19:10:50 +00:00
|
|
|
|
2023-07-31 19:10:50 +00:00
|
|
|
$this->setInterval(24 * 60 * 60); // 1 day
|
2024-10-07 15:36:55 +00:00
|
|
|
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
|
2023-07-31 19:10:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
|
|
|
*/
|
|
|
|
protected function run($argument) {
|
|
|
|
$this->reminderService->cleanUp(500);
|
|
|
|
}
|
|
|
|
}
|