From 391bc49dabb39e31739c849b83bb490cabf9da3d Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 16 Nov 2015 22:23:16 +0100 Subject: Move files/ajax/scan.php to background job The background job will now be executed in chunks of 500 users all 10 minutes. --- apps/files/appinfo/info.xml | 2 +- apps/files/appinfo/install.php | 26 ++++++++++++++++++++++++++ apps/files/appinfo/routes.php | 2 -- apps/files/appinfo/update.php | 5 +++++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 apps/files/appinfo/install.php (limited to 'apps/files/appinfo') diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index 4ab226f3968..df12b87397d 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -8,7 +8,7 @@ true - 1.4.0 + 1.4.1 diff --git a/apps/files/appinfo/install.php b/apps/files/appinfo/install.php new file mode 100644 index 00000000000..b47bf6ac4b0 --- /dev/null +++ b/apps/files/appinfo/install.php @@ -0,0 +1,26 @@ + + * + * @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 + * + */ + +// Cron job for scanning user storages +$jobList = \OC::$server->getJobList(); +$job = 'OCA\Files\BackgroundJob\ScanFiles'; +\OC::$server->getJobList()->add($job); + diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index 2bb913c30a6..844b73b3c41 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -75,8 +75,6 @@ $this->create('files_ajax_newfolder', 'ajax/newfolder.php') ->actionInclude('files/ajax/newfolder.php'); $this->create('files_ajax_rename', 'ajax/rename.php') ->actionInclude('files/ajax/rename.php'); -$this->create('files_ajax_scan', 'ajax/scan.php') - ->actionInclude('files/ajax/scan.php'); $this->create('files_ajax_upload', 'ajax/upload.php') ->actionInclude('files/ajax/upload.php'); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 6084435fa5a..d181dff560b 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -96,6 +96,11 @@ if ($installedVersion === '1.1.9' && ( } } +// Add cron job for scanning user storages +$jobList = \OC::$server->getJobList(); +$job = 'OCA\Files\BackgroundJob\ScanFiles'; +\OC::$server->getJobList()->add($job); + /** * migrate old constant DEBUG to new config value 'debug' * -- cgit v1.2.3