aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Upload/UploadFolder.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Upload/UploadFolder.php')
-rw-r--r--apps/dav/lib/Upload/UploadFolder.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/dav/lib/Upload/UploadFolder.php b/apps/dav/lib/Upload/UploadFolder.php
index b3d43fef95d..233c3ac3e52 100644
--- a/apps/dav/lib/Upload/UploadFolder.php
+++ b/apps/dav/lib/Upload/UploadFolder.php
@@ -22,16 +22,22 @@
*/
namespace OCA\DAV\Upload;
+use OCA\DAV\BackgroundJob\UploadCleanup;
use OCA\DAV\Connector\Sabre\Directory;
+use OCP\BackgroundJob\IJobList;
use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\ICollection;
class UploadFolder implements ICollection {
+ /** @var Directory */
private $node;
+ /** @var CleanupService */
+ private $cleanupService;
- function __construct(Directory $node) {
+ function __construct(Directory $node, CleanupService $cleanupService) {
$this->node = $node;
+ $this->cleanupService = $cleanupService;
}
function createFile($name, $data = null) {
@@ -65,6 +71,9 @@ class UploadFolder implements ICollection {
function delete() {
$this->node->delete();
+
+ // Background cleanup job is not needed anymore
+ $this->cleanupService->removeJob($this->getName());
}
function getName() {