Skip to content

Commit 276fe7a

Browse files
committed
Add background job for token cleanup
Signed-off-by: Julius Härtl <[email protected]>
1 parent 14f935d commit 276fe7a

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

apps/files/appinfo/info.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>Files</name>
66
<summary>File Management</summary>
77
<description>File Management</description>
8-
<version>1.13.0</version>
8+
<version>1.13.1</version>
99
<licence>agpl</licence>
1010
<author>Robin Appelman</author>
1111
<author>Vincent Petry</author>
@@ -26,6 +26,7 @@
2626
<job>OCA\Files\BackgroundJob\ScanFiles</job>
2727
<job>OCA\Files\BackgroundJob\DeleteOrphanedItems</job>
2828
<job>OCA\Files\BackgroundJob\CleanupFileLocks</job>
29+
<job>OCA\Files\BackgorundJob\CleanupDirectEditingTokens</job>
2930
</background-jobs>
3031

3132
<commands>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace OCA\Files\BackgroundJob;
4+
5+
use OC\BackgroundJob\TimedJob;
6+
use OCP\DirectEditing\IManager;
7+
8+
class CleanupDirectEditingTokens extends TimedJob {
9+
10+
const INTERVAL_MINUTES = 1;
11+
12+
/**
13+
* @var IManager
14+
*/
15+
private $manager;
16+
17+
public function __construct(IManager $manager) {
18+
$this->interval = self::INTERVAL_MINUTES;
19+
$this->manager = $manager;
20+
}
21+
22+
/**
23+
* Makes the background job do its work
24+
*
25+
* @param array $argument unused argument
26+
* @throws \Exception
27+
*/
28+
public function run($argument) {
29+
$this->manager->cleanup();
30+
\OC::$server->getLogger()->error('CleanupDirectEditing');
31+
}
32+
}

0 commit comments

Comments
 (0)