2019-11-06 04:41:08 -05:00
|
|
|
<?php
|
2022-12-05 04:13:34 -05:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2019-12-03 13:57:53 -05:00
|
|
|
/**
|
2024-05-28 10:42:42 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-12-03 13:57:53 -05:00
|
|
|
*/
|
2019-11-06 04:41:08 -05:00
|
|
|
namespace OCA\Files\BackgroundJob;
|
|
|
|
|
|
2022-12-05 04:13:34 -05:00
|
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
|
|
|
use OCP\BackgroundJob\TimedJob;
|
2019-11-06 04:41:08 -05:00
|
|
|
use OCP\DirectEditing\IManager;
|
|
|
|
|
|
|
|
|
|
class CleanupDirectEditingTokens extends TimedJob {
|
2022-12-05 04:13:34 -05:00
|
|
|
private IManager $manager;
|
2019-11-06 04:41:08 -05:00
|
|
|
|
2022-12-05 04:13:34 -05:00
|
|
|
public function __construct(ITimeFactory $time,
|
2023-11-23 04:22:34 -05:00
|
|
|
IManager $manager) {
|
2022-12-05 04:13:34 -05:00
|
|
|
parent::__construct($time);
|
2024-10-07 11:36:55 -04:00
|
|
|
$this->setInterval(15 * 60);
|
2019-11-06 04:41:08 -05:00
|
|
|
$this->manager = $manager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Makes the background job do its work
|
|
|
|
|
*
|
|
|
|
|
* @param array $argument unused argument
|
|
|
|
|
* @throws \Exception
|
|
|
|
|
*/
|
|
|
|
|
public function run($argument) {
|
|
|
|
|
$this->manager->cleanup();
|
|
|
|
|
}
|
|
|
|
|
}
|