summaryrefslogtreecommitdiffstats
path: root/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-11-06 10:41:08 +0100
committerJulius Härtl <jus@bitgrid.net>2019-11-27 14:36:20 +0100
commit103c6fb39eab36063b16767abb33da0395b2b9c8 (patch)
tree8e57cea684723a063fb65b5ae5a9acb39a8a7241 /apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
parentbccf2367384f3d093b2988eb6d09e4f9c9a899a4 (diff)
downloadnextcloud-server-103c6fb39eab36063b16767abb33da0395b2b9c8.tar.gz
nextcloud-server-103c6fb39eab36063b16767abb33da0395b2b9c8.zip
Add background job for token cleanup
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php')
-rw-r--r--apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
new file mode 100644
index 00000000000..77907fab281
--- /dev/null
+++ b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace OCA\Files\BackgroundJob;
+
+use OC\BackgroundJob\TimedJob;
+use OCP\DirectEditing\IManager;
+
+class CleanupDirectEditingTokens extends TimedJob {
+
+ 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();
+ }
+}