aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2024-06-18 15:24:37 +0200
committerGitHub <noreply@github.com>2024-06-18 15:24:37 +0200
commit4e840fb17aefdc046dd3f7a0cca3eb15930ff9b4 (patch)
tree749864ce10ca9e58c3e5a05b2e0106eb00faef4b /lib
parentae4a64b724ef332c5cc8b1defd7753b9460b4a35 (diff)
parentea9f2361ae5691a8d0eae8b38cd7e2fad55bdd55 (diff)
downloadnextcloud-server-4e840fb17aefdc046dd3f7a0cca3eb15930ff9b4.tar.gz
nextcloud-server-4e840fb17aefdc046dd3f7a0cca3eb15930ff9b4.zip
Merge pull request #45945 from nextcloud/perf/upgrade-reset-steps
perf: Avoid reusing previous migration steps
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Repair.php2
-rw-r--r--lib/private/legacy/OC_App.php8
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/Repair.php b/lib/private/Repair.php
index b265d5767ea..d8a110d5a20 100644
--- a/lib/private/Repair.php
+++ b/lib/private/Repair.php
@@ -102,6 +102,8 @@ class Repair implements IOutput {
$this->dispatcher->dispatchTyped(new RepairErrorEvent($e->getMessage()));
}
}
+
+ $this->repairSteps = [];
}
/**
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index c9d1f86cb0e..cb1a7b111c6 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -19,8 +19,10 @@ use OCP\App\ManagerEvent;
use OCP\Authentication\IAlternativeLogin;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IAppConfig;
+use OCP\Server;
use Psr\Container\ContainerExceptionInterface;
use Psr\Log\LoggerInterface;
+use function OCP\Log\logger;
/**
* This class manages the apps. It allows them to register and integrate in the
@@ -777,16 +779,16 @@ class OC_App {
// load the app
self::loadApp($appId);
- $dispatcher = \OC::$server->get(IEventDispatcher::class);
+ $dispatcher = Server::get(IEventDispatcher::class);
// load the steps
- $r = \OCP\Server::get(Repair::class);
+ $r = Server::get(Repair::class);
foreach ($steps as $step) {
try {
$r->addStep($step);
} catch (Exception $ex) {
$dispatcher->dispatchTyped(new RepairErrorEvent($ex->getMessage()));
- \OC::$server->getLogger()->logException($ex);
+ logger('core')->error('Failed to add app migration step ' . $step, ['exception' => $ex]);
}
}
// run the steps