diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-08 14:47:50 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-14 13:25:55 +0200 |
commit | 253f962241ba7c96610f22e6940c31184650041d (patch) | |
tree | 4142059ceba15c6bf5748b8260285c9a11940f3e /lib/private | |
parent | 3bfa031f38ded2da90ce6051187fcbcb53f67cc2 (diff) | |
download | nextcloud-server-253f962241ba7c96610f22e6940c31184650041d.tar.gz nextcloud-server-253f962241ba7c96610f22e6940c31184650041d.zip |
Add the job
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Repair.php | 4 | ||||
-rw-r--r-- | lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php | 48 | ||||
-rw-r--r-- | lib/private/Setup.php | 2 |
3 files changed, 53 insertions, 1 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php index a257ef061e7..8746f1e6f27 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -36,6 +36,7 @@ use OC\Repair\Collation; use OC\Repair\MoveUpdaterStepFile; use OC\Repair\NC11\FixMountStorages; use OC\Repair\NC13\AddLogRotateJob; +use OC\Repair\NC14\AddPreviewBackgroundCleanupJob; use OC\Repair\OldGroupMembershipShares; use OC\Repair\Owncloud\DropAccountTermsTable; use OC\Repair\Owncloud\SaveAccountsTableData; @@ -132,7 +133,8 @@ class Repair implements IOutput{ new FixMountStorages(\OC::$server->getDatabaseConnection()), new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), new AddLogRotateJob(\OC::$server->getJobList()), - new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OC::$server->query(SCSSCacher::class), \OC::$server->query(JSCombiner::class)) + new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OC::$server->query(SCSSCacher::class), \OC::$server->query(JSCombiner::class)), + new AddPreviewBackgroundCleanupJob(\OC::$server->getJobList()), ]; } diff --git a/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php b/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php new file mode 100644 index 00000000000..b58fabcba50 --- /dev/null +++ b/lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php @@ -0,0 +1,48 @@ +<?php +declare(strict_types=1); +/** + * @copyright 2018, Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OC\Repair\NC14; + +use OC\Preview\BackgroundCleanupJob; +use OCP\BackgroundJob\IJobList; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; + +class AddPreviewBackgroundCleanupJob implements IRepairStep { + + /** @var IJobList */ + private $jobList; + + public function __construct(IJobList $jobList) { + $this->jobList = $jobList; + } + + public function getName(): string { + return 'Add preview background cleanup job'; + } + + public function run(IOutput $output) { + $this->jobList->add(BackgroundCleanupJob::class); + } + +} diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 5564bb5b072..25e0b4d8817 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -47,6 +47,7 @@ use OC\App\AppStore\Bundles\BundleFetcher; use OC\Authentication\Token\DefaultTokenCleanupJob; use OC\Authentication\Token\DefaultTokenProvider; use OC\Log\Rotate; +use OC\Preview\BackgroundCleanupJob; use OCP\Defaults; use OCP\IL10N; use OCP\ILogger; @@ -419,6 +420,7 @@ class Setup { $jobList = \OC::$server->getJobList(); $jobList->add(DefaultTokenCleanupJob::class); $jobList->add(Rotate::class); + $jobList->add(BackgroundCleanupJob::class); } /** |