2018-11-02 16:19:27 -04:00
|
|
|
<?php
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2018-11-02 16:19:27 -04:00
|
|
|
declare(strict_types=1);
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2018-11-02 16:19:27 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-11-02 16:19:27 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\DAV\Upload;
|
|
|
|
|
|
|
|
|
|
use OCA\DAV\BackgroundJob\UploadCleanup;
|
|
|
|
|
use OCP\BackgroundJob\IJobList;
|
|
|
|
|
|
|
|
|
|
class CleanupService {
|
2024-10-18 06:04:22 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private IJobList $jobList,
|
|
|
|
|
) {
|
2018-11-02 16:19:27 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-14 09:44:59 -04:00
|
|
|
public function addJob(string $uid, string $folder) {
|
|
|
|
|
$this->jobList->add(UploadCleanup::class, ['uid' => $uid, 'folder' => $folder]);
|
2018-11-02 16:19:27 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-14 09:44:59 -04:00
|
|
|
public function removeJob(string $uid, string $folder) {
|
|
|
|
|
$this->jobList->remove(UploadCleanup::class, ['uid' => $uid, 'folder' => $folder]);
|
2018-11-02 16:19:27 -04:00
|
|
|
}
|
|
|
|
|
}
|