From 49b98abc25f33da9e37e57a64b033de3e2edad36 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 2 Sep 2015 19:26:22 +0200 Subject: [PATCH] Move registration of background job to install/update --- apps/files_sharing/appinfo/app.php | 4 ---- apps/files_sharing/appinfo/install.php | 22 ++++++++++++++++++++++ apps/files_sharing/appinfo/update.php | 1 + apps/files_sharing/appinfo/version | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 apps/files_sharing/appinfo/install.php diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 9000fafd8dd..295d013beff 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -58,10 +58,6 @@ $application->setupPropagation(); \OCP\Util::addScript('files_sharing', 'external'); \OCP\Util::addStyle('files_sharing', 'sharetabview'); -// FIXME: registering a job here will cause additional useless SQL queries -// when the route is not cron.php, needs a better way -\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob'); - \OC::$server->getActivityManager()->registerExtension(function() { return new \OCA\Files_Sharing\Activity( \OC::$server->query('L10NFactory'), diff --git a/apps/files_sharing/appinfo/install.php b/apps/files_sharing/appinfo/install.php new file mode 100644 index 00000000000..f076a17e444 --- /dev/null +++ b/apps/files_sharing/appinfo/install.php @@ -0,0 +1,22 @@ + + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @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 + * + */ + +\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob'); diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index e98b60ea36d..66b8b78cacf 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -28,3 +28,4 @@ if (version_compare($installedVersion, '0.6.0', '<')) { $m->addAcceptRow(); } +\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob'); diff --git a/apps/files_sharing/appinfo/version b/apps/files_sharing/appinfo/version index b6160487433..844f6a91acb 100644 --- a/apps/files_sharing/appinfo/version +++ b/apps/files_sharing/appinfo/version @@ -1 +1 @@ -0.6.2 +0.6.3