1
0

CleanupDirectEditingTokens.php 798 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Files\BackgroundJob;
  8. use OCP\AppFramework\Utility\ITimeFactory;
  9. use OCP\BackgroundJob\TimedJob;
  10. use OCP\DirectEditing\IManager;
  11. class CleanupDirectEditingTokens extends TimedJob {
  12. private const INTERVAL_MINUTES = 15 * 60;
  13. private IManager $manager;
  14. public function __construct(ITimeFactory $time,
  15. IManager $manager) {
  16. parent::__construct($time);
  17. $this->interval = self::INTERVAL_MINUTES;
  18. $this->manager = $manager;
  19. }
  20. /**
  21. * Makes the background job do its work
  22. *
  23. * @param array $argument unused argument
  24. * @throws \Exception
  25. */
  26. public function run($argument) {
  27. $this->manager->cleanup();
  28. }
  29. }