summaryrefslogtreecommitdiffstats
path: root/lib/private/Repair/DropOldJobs.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-22 22:20:56 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-02-22 22:35:18 -0600
commit2bbf3b18d90301e4c1afc8deb5ef0cf9b91a6ff9 (patch)
treeff6b9d5e9f7f6a16b6f10605ce9aacc779fa1176 /lib/private/Repair/DropOldJobs.php
parentc2d3e12e23a0315c2ef14aab9235dfec1f6b9e26 (diff)
downloadnextcloud-server-2bbf3b18d90301e4c1afc8deb5ef0cf9b91a6ff9.tar.gz
nextcloud-server-2bbf3b18d90301e4c1afc8deb5ef0cf9b91a6ff9.zip
cleanup old and not needed repair steps to speed up the update
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Repair/DropOldJobs.php')
-rw-r--r--lib/private/Repair/DropOldJobs.php88
1 files changed, 0 insertions, 88 deletions
diff --git a/lib/private/Repair/DropOldJobs.php b/lib/private/Repair/DropOldJobs.php
deleted file mode 100644
index 126df9e940f..00000000000
--- a/lib/private/Repair/DropOldJobs.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OC\Repair;
-
-use OCP\BackgroundJob\IJobList;
-use OCP\Migration\IOutput;
-use OCP\Migration\IRepairStep;
-
-class DropOldJobs implements IRepairStep {
-
- /** @var IJobList */
- protected $jobList;
-
- /**
- * @param IJobList $jobList
- */
- public function __construct(IJobList $jobList) {
- $this->jobList = $jobList;
- }
-
- /**
- * Returns the step's name
- *
- * @return string
- */
- public function getName() {
- return 'Drop old background jobs';
- }
-
- /**
- * Run repair step.
- * Must throw exception on error.
- *
- * @throws \Exception in case of failure
- */
- public function run(IOutput $output) {
- $oldJobs = $this->oldJobs();
- foreach($oldJobs as $job) {
- if($this->jobList->has($job['class'], $job['arguments'])) {
- $this->jobList->remove($job['class'], $job['arguments']);
- }
- }
- }
-
- /**
- * returns a list of old jobs as an associative array with keys 'class' and
- * 'arguments'.
- *
- * @return array
- */
- public function oldJobs() {
- return [
- ['class' => 'OC_Cache_FileGlobalGC', 'arguments' => null],
- ['class' => 'OC\Cache\FileGlobalGC', 'arguments' => null],
- ['class' => 'OCA\Files\BackgroundJob\DeleteOrphanedTagsJob', 'arguments' => null],
-
- ['class' => 'OCA\Files_sharing\Lib\DeleteOrphanedSharesJob', 'arguments' => null],
- ['class' => 'OCA\Files_sharing\ExpireSharesJob', 'arguments' => null],
-
- ['class' => 'OCA\user_ldap\lib\Jobs', 'arguments' => null],
- ['class' => '\OCA\User_LDAP\Jobs\CleanUp', 'arguments' => null],
- ];
- }
-
-
-}