summaryrefslogtreecommitdiffstats
path: root/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
blob: 8d4a3f2378743adfb216ee59cb60b619b8b195d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace OCA\Files\BackgroundJob;

use OC\BackgroundJob\TimedJob;
use OCP\DirectEditing\IManager;

class CleanupDirectEditingTokens extends TimedJob {

	private const INTERVAL_MINUTES = 15 * 60;

	/**
	 * @var IManager
	 */
	private $manager;

	public function __construct(IManager $manager) {
		$this->interval = self::INTERVAL_MINUTES;
		$this->manager = $manager;
	}

	/**
	 * Makes the background job do its work
	 *
	 * @param array $argument unused argument
	 * @throws \Exception
	 */
	public function run($argument) {
		$this->manager->cleanup();
	}
}