CleanupDirectEditingTokens.php 741 B

12345678910111213141516171819202122232425262728293031323334
  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 IManager $manager;
  13. public function __construct(ITimeFactory $time,
  14. IManager $manager) {
  15. parent::__construct($time);
  16. $this->setInterval(15 * 60);
  17. $this->manager = $manager;
  18. }
  19. /**
  20. * Makes the background job do its work
  21. *
  22. * @param array $argument unused argument
  23. * @throws \Exception
  24. */
  25. public function run($argument) {
  26. $this->manager->cleanup();
  27. }
  28. }