aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Upload/CleanupService.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Upload/CleanupService.php')
-rw-r--r--apps/dav/lib/Upload/CleanupService.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/dav/lib/Upload/CleanupService.php b/apps/dav/lib/Upload/CleanupService.php
new file mode 100644
index 00000000000..ffa6bad533c
--- /dev/null
+++ b/apps/dav/lib/Upload/CleanupService.php
@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCA\DAV\Upload;
+
+use OCA\DAV\BackgroundJob\UploadCleanup;
+use OCP\BackgroundJob\IJobList;
+
+class CleanupService {
+ public function __construct(
+ private IJobList $jobList,
+ ) {
+ }
+
+ public function addJob(string $uid, string $folder) {
+ $this->jobList->add(UploadCleanup::class, ['uid' => $uid, 'folder' => $folder]);
+ }
+
+ public function removeJob(string $uid, string $folder) {
+ $this->jobList->remove(UploadCleanup::class, ['uid' => $uid, 'folder' => $folder]);
+ }
+}