chore: Inline OC_App::setupBackgroundJobs

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-07-29 17:53:16 +02:00
parent e5606d7fe3
commit 0e01bc09a9
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
3 changed files with 13 additions and 2 deletions

View file

@ -1055,7 +1055,10 @@ class AppManager implements IAppManager {
$this->clearAppsCache();
$this->getAppVersion($appId, false);
\OC_App::setupBackgroundJobs($appData['background-jobs']);
// Setup background jobs
foreach ($appData['background-jobs'] as $job) {
$queue->add($job);
}
//set remote/public handlers
foreach ($appData['remote'] as $name => $path) {

View file

@ -21,6 +21,7 @@ use OC\Files\FilenameValidator;
use OC_App;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\BackgroundJob\IJobList;
use OCP\Files;
use OCP\HintException;
use OCP\Http\Client\IClientService;
@ -552,7 +553,11 @@ class Installer {
$output->debug('Registering tasks of ' . $info['id']);
}
\OC_App::setupBackgroundJobs($info['background-jobs']);
// Setup background jobs
$queue = Server::get(IJobList::class);
foreach ($info['background-jobs'] as $job) {
$queue->add($job);
}
// Run appinfo/install.php
self::includeAppScript($appPath . '/appinfo/install.php');

View file

@ -575,6 +575,9 @@ class OC_App {
$r->run();
}
/**
* @deprecated 32.0.0 Use the IJobList directly instead
*/
public static function setupBackgroundJobs(array $jobs) {
$queue = \OC::$server->getJobList();
foreach ($jobs as $job) {