From 3d1acca1f389db89298f5b8445118b75c56c5e7f Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 30 May 2023 17:48:20 +0200 Subject: [PATCH] chore(app): Do not clear unused cache key Signed-off-by: Christoph Wurst --- lib/private/App/AppManager.php | 2 -- tests/lib/App/AppManagerTest.php | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 9b038b7382689..b881d37440e9f 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -673,8 +673,6 @@ public function getAppWebPath(string $appId): string { * Clear the cached list of apps when enabling/disabling an app */ public function clearAppsCache() { - $settingsMemCache = $this->memCacheFactory->createDistributed('settings'); - $settingsMemCache->clear('listApps'); $this->appInfos = []; } diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 3518ada331436..d597b21604111 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -133,14 +133,7 @@ protected function setUp(): void { ); } - protected function expectClearCache() { - $this->cache->expects($this->once()) - ->method('clear') - ->with('listApps'); - } - public function testEnableApp() { - $this->expectClearCache(); // making sure "files_trashbin" is disabled if ($this->manager->isEnabledForUser('files_trashbin')) { $this->manager->disableApp('files_trashbin'); @@ -151,7 +144,6 @@ public function testEnableApp() { } public function testDisableApp() { - $this->expectClearCache(); $this->eventDispatcher->expects($this->once())->method('dispatchTyped')->with(new AppDisableEvent('files_trashbin')); $this->manager->disableApp('files_trashbin'); $this->assertEquals('no', $this->appConfig->getValue('files_trashbin', 'enabled', 'no')); @@ -180,7 +172,6 @@ public function testEnableAppForGroups() { ->willReturn('group2'); $groups = [$group1, $group2]; - $this->expectClearCache(); /** @var AppManager|MockObject $manager */ $manager = $this->getMockBuilder(AppManager::class) @@ -229,7 +220,6 @@ public function testEnableAppForGroupsAllowedTypes(array $appInfo) { ->willReturn('group2'); $groups = [$group1, $group2]; - $this->expectClearCache(); /** @var AppManager|MockObject $manager */ $manager = $this->getMockBuilder(AppManager::class)