Browse Source

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
remotes/origin/ceph-wait-for-http
Joas Schilling 10 years ago
committed by Thomas Müller
parent
commit
eea98f1d74
  1. 5
      apps/federation/appinfo/application.php
  2. 4
      apps/federation/appinfo/info.xml
  3. 23
      apps/federation/appinfo/install.php
  4. 23
      apps/federation/appinfo/update.php
  5. 6
      apps/files/appinfo/info.xml
  6. 27
      apps/files/appinfo/install.php
  7. 5
      apps/files/appinfo/update.php
  8. 5
      apps/files_sharing/appinfo/info.xml
  9. 24
      apps/files_sharing/appinfo/install.php
  10. 3
      apps/files_sharing/appinfo/update.php
  11. 4
      apps/files_trashbin/appinfo/info.xml
  12. 23
      apps/files_trashbin/appinfo/install.php
  13. 3
      apps/files_trashbin/appinfo/update.php
  14. 4
      apps/files_versions/appinfo/info.xml
  15. 23
      apps/files_versions/appinfo/install.php
  16. 23
      apps/files_versions/appinfo/update.php
  17. 5
      apps/user_ldap/appinfo/info.xml
  18. 3
      apps/user_ldap/appinfo/install.php
  19. 24
      apps/user_ldap/appinfo/update.php

5
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 * @return SyncFederationAddressBooks
*/ */

4
apps/federation/appinfo/info.xml

@ -15,4 +15,8 @@
<types> <types>
<authentication/> <authentication/>
</types> </types>
<background-jobs>
<job>OCA\Federation\SyncJob</job>
</background-jobs>
</info> </info>

23
apps/federation/appinfo/install.php

@ -1,23 +0,0 @@
<?php
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
$app = new \OCA\Federation\AppInfo\Application();
$app->setupCron();

23
apps/federation/appinfo/update.php

@ -1,23 +0,0 @@
<?php
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
$app = new \OCA\Federation\AppInfo\Application();
$app->setupCron();

6
apps/files/appinfo/info.xml

@ -16,4 +16,10 @@
<documentation> <documentation>
<user>user-files</user> <user>user-files</user>
</documentation> </documentation>
<background-jobs>
<job>OCA\Files\BackgroundJob\ScanFiles</job>
<job>OCA\Files\BackgroundJob\DeleteOrphanedItems</job>
<job>OCA\Files\BackgroundJob\CleanupFileLocks</job>
</background-jobs>
</info> </info>

27
apps/files/appinfo/install.php

@ -1,27 +0,0 @@
<?php
/**
* @author Arthur Schiwon <blizzz@owncloud.com>
* @author Lukas Reschke <lukas@owncloud.com>
* @author Vincent Petry <pvince81@owncloud.com>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
// 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');

5
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');

5
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> <public>
<files>public.php</files> <files>public.php</files>
</public> </public>
<background-jobs>
<job>OCA\Files_sharing\Lib\DeleteOrphanedSharesJob</job>
<job>OCA\Files_sharing\ExpireSharesJob</job>
</background-jobs>
</info> </info>

24
apps/files_sharing/appinfo/install.php

@ -1,24 +0,0 @@
<?php
/**
* @author Joas Schilling <nickvergessen@owncloud.com>
* @author Morris Jobke <hey@morrisjobke.de>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob');
\OC::$server->getJobList()->add('OCA\Files_sharing\ExpireSharesJob');

3
apps/files_sharing/appinfo/update.php

@ -31,6 +31,3 @@ if (version_compare($installedVersion, '0.9.1', '<')) {
$m->removeReShares(); $m->removeReShares();
$m->updateInitiatorInfo(); $m->updateInitiatorInfo();
} }
\OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob');
\OC::$server->getJobList()->add('OCA\Files_sharing\ExpireSharesJob');

4
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
<documentation> <documentation>
<user>user-trashbin</user> <user>user-trashbin</user>
</documentation> </documentation>
<background-jobs>
<job>OCA\Files_Trashbin\BackgroundJob\ExpireTrash</job>
</background-jobs>
</info> </info>

23
apps/files_trashbin/appinfo/install.php

@ -1,23 +0,0 @@
<?php
/**
* @author Victor Dubiniuk <dubiniuk@owncloud.com>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
// Cron job for deleting expired trash items
\OC::$server->getJobList()->add('OCA\Files_Trashbin\BackgroundJob\ExpireTrash');

3
apps/files_trashbin/appinfo/update.php

@ -39,6 +39,3 @@ if (version_compare($installedVersion, '0.6.4', '<')) {
$config->setSystemValue('trashbin_retention_obligation', $newObligation); $config->setSystemValue('trashbin_retention_obligation', $newObligation);
$config->deleteSystemValue('trashbin_auto_expire'); $config->deleteSystemValue('trashbin_auto_expire');
} }
// Cron job for deleting expired trash items
\OC::$server->getJobList()->add('OCA\Files_Trashbin\BackgroundJob\ExpireTrash');

4
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>user-versions</user> <user>user-versions</user>
</documentation> </documentation>
<default_enable/> <default_enable/>
<background-jobs>
<job>OCA\Files_Versions\BackgroundJob\ExpireVersions</job>
</background-jobs>
</info> </info>

23
apps/files_versions/appinfo/install.php

@ -1,23 +0,0 @@
<?php
/**
* @author Victor Dubiniuk <dubiniuk@owncloud.com>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
// Cron job for deleting expired trash items
\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions');

23
apps/files_versions/appinfo/update.php

@ -1,23 +0,0 @@
<?php
/**
* @author Victor Dubiniuk <dubiniuk@owncloud.com>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
// Cron job for deleting expired trash items
\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions');

5
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
<lib>ldap</lib> <lib>ldap</lib>
<owncloud min-version="9.1" max-version="9.1" /> <owncloud min-version="9.1" max-version="9.1" />
</dependencies> </dependencies>
<background-jobs>
<job>OCA\user_ldap\lib\Jobs</job>
<job>\OCA\User_LDAP\Jobs\CleanUp</job>
</background-jobs>
</info> </info>

3
apps/user_ldap/appinfo/install.php

@ -24,6 +24,3 @@ $state = OCP\Config::getSystemValue('ldapIgnoreNamingRules', 'doSet');
if($state === 'doSet') { if($state === 'doSet') {
OCP\Config::setSystemValue('ldapIgnoreNamingRules', false); OCP\Config::setSystemValue('ldapIgnoreNamingRules', false);
} }
OCP\Backgroundjob::registerJob('OCA\user_ldap\lib\Jobs');
OCP\Backgroundjob::registerJob('\OCA\User_LDAP\Jobs\CleanUp');

24
apps/user_ldap/appinfo/update.php

@ -1,24 +0,0 @@
<?php
/**
* @author Joas Schilling <nickvergessen@owncloud.com>
* @author Morris Jobke <hey@morrisjobke.de>
*
* @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 <http://www.gnu.org/licenses/>
*
*/
OCP\Backgroundjob::registerJob('OCA\user_ldap\lib\Jobs');
OCP\Backgroundjob::registerJob('\OCA\User_LDAP\Jobs\CleanUp');
Loading…
Cancel
Save