aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Migration
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Migration')
-rw-r--r--lib/private/Migration/BackgroundRepair.php22
-rw-r--r--lib/private/Migration/ConsoleOutput.php1
-rw-r--r--lib/private/Migration/MetadataManager.php4
-rw-r--r--lib/private/Migration/NullOutput.php1
-rw-r--r--lib/private/Migration/SimpleOutput.php1
5 files changed, 8 insertions, 21 deletions
diff --git a/lib/private/Migration/BackgroundRepair.php b/lib/private/Migration/BackgroundRepair.php
index cbc21e4fe12..d542b82d5e1 100644
--- a/lib/private/Migration/BackgroundRepair.php
+++ b/lib/private/Migration/BackgroundRepair.php
@@ -7,9 +7,8 @@
*/
namespace OC\Migration;
-use OC\NeedsUpdateException;
use OC\Repair;
-use OC_App;
+use OCP\App\IAppManager;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\TimedJob;
@@ -26,6 +25,7 @@ class BackgroundRepair extends TimedJob {
ITimeFactory $time,
private LoggerInterface $logger,
private IJobList $jobList,
+ private IAppManager $appManager,
) {
parent::__construct($time);
$this->setInterval(15 * 60);
@@ -34,7 +34,6 @@ class BackgroundRepair extends TimedJob {
/**
* @param array $argument
* @throws \Exception
- * @throws \OC\NeedsUpdateException
*/
protected function run($argument): void {
if (!isset($argument['app']) || !isset($argument['step'])) {
@@ -44,13 +43,7 @@ class BackgroundRepair extends TimedJob {
}
$app = $argument['app'];
- try {
- $this->loadApp($app);
- } catch (NeedsUpdateException $ex) {
- // as long as the app is not yet done with it's offline migration
- // we better not start with the live migration
- return;
- }
+ $this->appManager->loadApp($app);
$step = $argument['step'];
$this->repair->setRepairSteps([]);
@@ -73,13 +66,4 @@ class BackgroundRepair extends TimedJob {
// remove the job once executed successfully
$this->jobList->remove($this, $this->argument);
}
-
- /**
- * @codeCoverageIgnore
- * @param $app
- * @throws NeedsUpdateException
- */
- protected function loadApp($app): void {
- OC_App::loadApp($app);
- }
}
diff --git a/lib/private/Migration/ConsoleOutput.php b/lib/private/Migration/ConsoleOutput.php
index 7ccc4e7825a..31412bf4ff0 100644
--- a/lib/private/Migration/ConsoleOutput.php
+++ b/lib/private/Migration/ConsoleOutput.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2015 ownCloud GmbH
diff --git a/lib/private/Migration/MetadataManager.php b/lib/private/Migration/MetadataManager.php
index fac9127a123..f4cb95342b4 100644
--- a/lib/private/Migration/MetadataManager.php
+++ b/lib/private/Migration/MetadataManager.php
@@ -73,7 +73,7 @@ class MetadataManager {
): array {
$appsAttributes = [];
foreach (array_keys($metadata['apps']) as $appId) {
- if ($filterKnownMigrations && !$this->appManager->isInstalled($appId)) {
+ if ($filterKnownMigrations && !$this->appManager->isEnabledForAnyone($appId)) {
continue; // if not interested and app is not installed
}
@@ -97,7 +97,7 @@ class MetadataManager {
* @since 30.0.0
*/
public function getUnsupportedApps(array $metadata): array {
- return array_values(array_diff($this->appManager->getInstalledApps(), array_keys($metadata['apps'])));
+ return array_values(array_diff($this->appManager->getEnabledApps(), array_keys($metadata['apps'])));
}
/**
diff --git a/lib/private/Migration/NullOutput.php b/lib/private/Migration/NullOutput.php
index 3f4cc38dba8..8db7b950af8 100644
--- a/lib/private/Migration/NullOutput.php
+++ b/lib/private/Migration/NullOutput.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
diff --git a/lib/private/Migration/SimpleOutput.php b/lib/private/Migration/SimpleOutput.php
index 31420d49932..b7a07cc6ff2 100644
--- a/lib/private/Migration/SimpleOutput.php
+++ b/lib/private/Migration/SimpleOutput.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2015 ownCloud GmbH