12345678910111213141516171819202122232425 |
- <?php
- namespace OC\Authentication\Token;
- use OCP\AppFramework\Utility\ITimeFactory;
- use OCP\BackgroundJob\TimedJob;
- class TokenCleanupJob extends TimedJob {
- private IProvider $provider;
- public function __construct(ITimeFactory $time, IProvider $provider) {
- parent::__construct($time);
- $this->provider = $provider;
-
- $this->setInterval(24 * 60 * 60);
- $this->setTimeSensitivity(self::TIME_INSENSITIVE);
- }
- protected function run($argument) {
- $this->provider->invalidateOldTokens();
- }
- }
|