From eea98f1d74daf2a20c6b08b9df743f0478c48103 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 12 May 2016 10:43:43 +0200 Subject: Background jobs from info.xml (#24582) * Move background job registration of Federation to info.xml * Move background registration of Files app to info.xml * Move background job registration of files_sharing to info.xml * Move background job registration of files_trashbin to info.xml * Move background job registration of files_versions to info.xml * Move background job registration from user_ldap to info.xml --- apps/federation/appinfo/application.php | 5 ----- apps/federation/appinfo/info.xml | 4 ++++ apps/federation/appinfo/install.php | 23 ----------------------- apps/federation/appinfo/update.php | 23 ----------------------- apps/files/appinfo/info.xml | 6 ++++++ apps/files/appinfo/install.php | 27 --------------------------- apps/files/appinfo/update.php | 5 ----- apps/files_sharing/appinfo/info.xml | 5 +++++ apps/files_sharing/appinfo/install.php | 24 ------------------------ apps/files_sharing/appinfo/update.php | 3 --- apps/files_trashbin/appinfo/info.xml | 4 ++++ apps/files_trashbin/appinfo/install.php | 23 ----------------------- apps/files_trashbin/appinfo/update.php | 3 --- apps/files_versions/appinfo/info.xml | 4 ++++ apps/files_versions/appinfo/install.php | 23 ----------------------- apps/files_versions/appinfo/update.php | 23 ----------------------- apps/user_ldap/appinfo/info.xml | 5 +++++ apps/user_ldap/appinfo/install.php | 3 --- apps/user_ldap/appinfo/update.php | 24 ------------------------ 19 files changed, 28 insertions(+), 209 deletions(-) delete mode 100644 apps/federation/appinfo/install.php delete mode 100644 apps/federation/appinfo/update.php delete mode 100644 apps/files/appinfo/install.php delete mode 100644 apps/files_sharing/appinfo/install.php delete mode 100644 apps/files_trashbin/appinfo/install.php delete mode 100644 apps/files_versions/appinfo/install.php delete mode 100644 apps/files_versions/appinfo/update.php delete mode 100644 apps/user_ldap/appinfo/update.php diff --git a/apps/federation/appinfo/application.php b/apps/federation/appinfo/application.php index 621a5d3d099..74185345329 100644 --- a/apps/federation/appinfo/application.php +++ b/apps/federation/appinfo/application.php @@ -169,11 +169,6 @@ class Application extends \OCP\AppFramework\App { }); } - public function setupCron() { - $jl = $this->getContainer()->getServer()->getJobList(); - $jl->add(new SyncJob()); - } - /** * @return SyncFederationAddressBooks */ diff --git a/apps/federation/appinfo/info.xml b/apps/federation/appinfo/info.xml index 3bd66e2954a..e51d3990cea 100644 --- a/apps/federation/appinfo/info.xml +++ b/apps/federation/appinfo/info.xml @@ -15,4 +15,8 @@ + + + OCA\Federation\SyncJob + diff --git a/apps/federation/appinfo/install.php b/apps/federation/appinfo/install.php deleted file mode 100644 index f2a98d7f555..00000000000 --- a/apps/federation/appinfo/install.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * @copyright Copyright (c) 2016, 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 - * - */ - -$app = new \OCA\Federation\AppInfo\Application(); -$app->setupCron(); diff --git a/apps/federation/appinfo/update.php b/apps/federation/appinfo/update.php deleted file mode 100644 index f2a98d7f555..00000000000 --- a/apps/federation/appinfo/update.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * @copyright Copyright (c) 2016, 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 - * - */ - -$app = new \OCA\Federation\AppInfo\Application(); -$app->setupCron(); diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index 79dc4b31346..573285f8b3b 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -16,4 +16,10 @@ user-files + + + OCA\Files\BackgroundJob\ScanFiles + OCA\Files\BackgroundJob\DeleteOrphanedItems + OCA\Files\BackgroundJob\CleanupFileLocks + diff --git a/apps/files/appinfo/install.php b/apps/files/appinfo/install.php deleted file mode 100644 index 55514935cda..00000000000 --- a/apps/files/appinfo/install.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @author Lukas Reschke - * @author Vincent Petry - * - * @copyright Copyright (c) 2016, 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 -\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\ScanFiles'); -\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\DeleteOrphanedItems'); -\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\CleanupFileLocks'); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 621ef7d2987..8fe6bb7b882 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -98,8 +98,3 @@ if ($installedVersion === '1.1.9' && ( } } } - -// Add cron job for scanning user storages -\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\ScanFiles'); -\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\DeleteOrphanedItems'); -\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\CleanupFileLocks'); diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 6b09e73a022..7e49e267275 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -20,4 +20,9 @@ Turning the feature off removes shared files and folders on the server for all s public.php + + + OCA\Files_sharing\Lib\DeleteOrphanedSharesJob + OCA\Files_sharing\ExpireSharesJob + diff --git a/apps/files_sharing/appinfo/install.php b/apps/files_sharing/appinfo/install.php deleted file mode 100644 index 33bbc8e2a84..00000000000 --- a/apps/files_sharing/appinfo/install.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @author Morris Jobke - * - * @copyright Copyright (c) 2016, 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'); -\OC::$server->getJobList()->add('OCA\Files_sharing\ExpireSharesJob'); diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index adfff183b3f..afa6f4383a3 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -31,6 +31,3 @@ if (version_compare($installedVersion, '0.9.1', '<')) { $m->removeReShares(); $m->updateInitiatorInfo(); } - -\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob'); -\OC::$server->getJobList()->add('OCA\Files_sharing\ExpireSharesJob'); diff --git a/apps/files_trashbin/appinfo/info.xml b/apps/files_trashbin/appinfo/info.xml index 52b00d90ff6..f5c1dcd979b 100644 --- a/apps/files_trashbin/appinfo/info.xml +++ b/apps/files_trashbin/appinfo/info.xml @@ -21,4 +21,8 @@ To prevent a user from running out of disk space, the ownCloud Deleted files app user-trashbin + + + OCA\Files_Trashbin\BackgroundJob\ExpireTrash + diff --git a/apps/files_trashbin/appinfo/install.php b/apps/files_trashbin/appinfo/install.php deleted file mode 100644 index 51b0bdf43c3..00000000000 --- a/apps/files_trashbin/appinfo/install.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * @copyright Copyright (c) 2016, 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 deleting expired trash items -\OC::$server->getJobList()->add('OCA\Files_Trashbin\BackgroundJob\ExpireTrash'); diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php index f0c95baeb71..cd839f0c2e0 100644 --- a/apps/files_trashbin/appinfo/update.php +++ b/apps/files_trashbin/appinfo/update.php @@ -39,6 +39,3 @@ if (version_compare($installedVersion, '0.6.4', '<')) { $config->setSystemValue('trashbin_retention_obligation', $newObligation); $config->deleteSystemValue('trashbin_auto_expire'); } - -// Cron job for deleting expired trash items -\OC::$server->getJobList()->add('OCA\Files_Trashbin\BackgroundJob\ExpireTrash'); diff --git a/apps/files_versions/appinfo/info.xml b/apps/files_versions/appinfo/info.xml index c70e58a12b2..03aa308bdb1 100644 --- a/apps/files_versions/appinfo/info.xml +++ b/apps/files_versions/appinfo/info.xml @@ -21,4 +21,8 @@ In addition to the expiry of versions, ownCloud’s versions app makes certain n user-versions + + + OCA\Files_Versions\BackgroundJob\ExpireVersions + diff --git a/apps/files_versions/appinfo/install.php b/apps/files_versions/appinfo/install.php deleted file mode 100644 index 81ff6337aa0..00000000000 --- a/apps/files_versions/appinfo/install.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * @copyright Copyright (c) 2016, 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 deleting expired trash items -\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions'); diff --git a/apps/files_versions/appinfo/update.php b/apps/files_versions/appinfo/update.php deleted file mode 100644 index 09ac6ce8a2f..00000000000 --- a/apps/files_versions/appinfo/update.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * @copyright Copyright (c) 2016, 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 deleting expired trash items -\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions'); diff --git a/apps/user_ldap/appinfo/info.xml b/apps/user_ldap/appinfo/info.xml index a1bb8a47687..b84a33f75a4 100644 --- a/apps/user_ldap/appinfo/info.xml +++ b/apps/user_ldap/appinfo/info.xml @@ -20,4 +20,9 @@ A user logs into ownCloud with their LDAP or AD credentials, and is granted acce ldap + + + OCA\user_ldap\lib\Jobs + \OCA\User_LDAP\Jobs\CleanUp + diff --git a/apps/user_ldap/appinfo/install.php b/apps/user_ldap/appinfo/install.php index 49c8f808ef3..71112682526 100644 --- a/apps/user_ldap/appinfo/install.php +++ b/apps/user_ldap/appinfo/install.php @@ -24,6 +24,3 @@ $state = OCP\Config::getSystemValue('ldapIgnoreNamingRules', 'doSet'); if($state === 'doSet') { OCP\Config::setSystemValue('ldapIgnoreNamingRules', false); } - -OCP\Backgroundjob::registerJob('OCA\user_ldap\lib\Jobs'); -OCP\Backgroundjob::registerJob('\OCA\User_LDAP\Jobs\CleanUp'); diff --git a/apps/user_ldap/appinfo/update.php b/apps/user_ldap/appinfo/update.php deleted file mode 100644 index 82f3e86bd33..00000000000 --- a/apps/user_ldap/appinfo/update.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @author Morris Jobke - * - * @copyright Copyright (c) 2016, 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 - * - */ - -OCP\Backgroundjob::registerJob('OCA\user_ldap\lib\Jobs'); -OCP\Backgroundjob::registerJob('\OCA\User_LDAP\Jobs\CleanUp'); -- cgit v1.2.3