1
0

CalendarRetentionJob.php 672 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\BackgroundJob;
  8. use OCA\DAV\CalDAV\RetentionService;
  9. use OCP\AppFramework\Utility\ITimeFactory;
  10. use OCP\BackgroundJob\TimedJob;
  11. class CalendarRetentionJob extends TimedJob {
  12. public function __construct(
  13. ITimeFactory $time,
  14. private RetentionService $service,
  15. ) {
  16. parent::__construct($time);
  17. // Run four times a day
  18. $this->setInterval(6 * 60 * 60);
  19. $this->setTimeSensitivity(self::TIME_SENSITIVE);
  20. }
  21. protected function run($argument): void {
  22. $this->service->cleanUp();
  23. }
  24. }