summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-12-14 10:45:09 +0100
committerGitHub <noreply@github.com>2017-12-14 10:45:09 +0100
commit1f108970c45c2269e68094ced1e9f13f1ac0f863 (patch)
treee4b564305b8a968a61c56d0aabcfa971fb1e99de
parentb5d9c3b972f296d9fe124d598a30bb215bf08d2b (diff)
parent54c227b6c4cf7c4597a45aa255be93cd4c14d1ec (diff)
downloadnextcloud-server-1f108970c45c2269e68094ced1e9f13f1ac0f863.tar.gz
nextcloud-server-1f108970c45c2269e68094ced1e9f13f1ac0f863.zip
Merge pull request #7506 from nextcloud/fix-app-cache
Use cached app list
-rw-r--r--lib/private/Installer.php4
-rw-r--r--tests/lib/InstallerTest.php1
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 48bd57f4c10..eb1f8a456bf 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -396,10 +396,10 @@ class Installer {
}
if ($this->apps === null) {
- $apps = $this->appFetcher->get();
+ $this->apps = $this->appFetcher->get();
}
- foreach($apps as $app) {
+ foreach($this->apps as $app) {
if($app['id'] === $appId) {
$currentVersion = OC_App::getAppVersion($appId);
$newestVersion = $app['releases'][0]['version'];
diff --git a/tests/lib/InstallerTest.php b/tests/lib/InstallerTest.php
index 897bc472103..c7e4bfeacfb 100644
--- a/tests/lib/InstallerTest.php
+++ b/tests/lib/InstallerTest.php
@@ -156,6 +156,7 @@ class InstallerTest extends TestCase {
$installer = $this->getInstaller();
$this->assertSame($updateAvailable, $installer->isUpdateAvailable('files'));
+ $this->assertSame($updateAvailable, $installer->isUpdateAvailable('files'), 'Cached result should be returned and fetcher should be only called once');
}
/**