1
0

CleanupDirectEditingTokens.php 697 B

123456789101112131415161718192021222324252627282930313233
  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. public function __construct(
  13. ITimeFactory $time,
  14. private IManager $manager,
  15. ) {
  16. parent::__construct($time);
  17. $this->setInterval(15 * 60);
  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. }