diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-10-24 20:38:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 20:38:40 +0200 |
commit | a82b56b1c7146ddb3085f3e03e18be4700d95a0e (patch) | |
tree | 0ca894c89b1617fb8b20c489a1104381eb22ee09 /lib/private | |
parent | b88db3a389c8211e58bcbc63674e336783ce81fe (diff) | |
parent | 80e4d48db919024ab1168c478cf2e0227caf2dfd (diff) | |
download | nextcloud-server-a82b56b1c7146ddb3085f3e03e18be4700d95a0e.tar.gz nextcloud-server-a82b56b1c7146ddb3085f3e03e18be4700d95a0e.zip |
Merge pull request #6918 from nextcloud/rotate_job_by_default
Add logrote as a default background job
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Repair.php | 2 | ||||
-rw-r--r-- | lib/private/Repair/NC13/AddLogRotateJob.php | 47 | ||||
-rw-r--r-- | lib/private/Setup.php | 5 |
3 files changed, 53 insertions, 1 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 80cd3c7fd45..ac824095d53 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -41,6 +41,7 @@ use OC\Repair\NC11\MoveAvatars; use OC\Repair\NC12\InstallCoreBundle; use OC\Repair\NC12\UpdateLanguageCodes; use OC\Repair\NC12\RepairIdentityProofKeyFolders; +use OC\Repair\NC13\AddLogRotateJob; use OC\Repair\OldGroupMembershipShares; use OC\Repair\Owncloud\DropAccountTermsTable; use OC\Repair\Owncloud\SaveAccountsTableData; @@ -150,6 +151,7 @@ class Repair implements IOutput{ ), new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), new RepairIdentityProofKeyFolders(\OC::$server->getConfig(), \OC::$server->query(Factory::class), \OC::$server->getRootFolder()), + new AddLogRotateJob(\OC::$server->getJobList()), ]; } diff --git a/lib/private/Repair/NC13/AddLogRotateJob.php b/lib/private/Repair/NC13/AddLogRotateJob.php new file mode 100644 index 00000000000..c65ea47f02b --- /dev/null +++ b/lib/private/Repair/NC13/AddLogRotateJob.php @@ -0,0 +1,47 @@ +<?php +/** + * @copyright 2017, 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\NC13; + +use OC\Log\Rotate; +use OCP\BackgroundJob\IJobList; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; + +class AddLogRotateJob implements IRepairStep { + + /** @var IJobList */ + private $jobList; + + public function __construct(IJobList $jobList) { + $this->jobList = $jobList; + } + + public function getName() { + return 'Add log rotate job'; + } + + public function run(IOutput $output) { + $this->jobList->add(Rotate::class); + } + +} diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 5228d52b05f..4e1e4ece62d 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -44,6 +44,7 @@ use Exception; use OC\App\AppStore\Bundles\BundleFetcher; use OC\Authentication\Token\DefaultTokenCleanupJob; use OC\Authentication\Token\DefaultTokenProvider; +use OC\Log\Rotate; use OCP\Defaults; use OCP\IL10N; use OCP\ILogger; @@ -426,7 +427,9 @@ class Setup { } public static function installBackgroundJobs() { - \OC::$server->getJobList()->add(DefaultTokenCleanupJob::class); + $jobList = \OC::$server->getJobList(); + $jobList->add(DefaultTokenCleanupJob::class); + $jobList->add(Rotate::class); } /** |