Merge pull request #7506 from nextcloud/fix-app-cache

Use cached app list
This commit is contained in:
Morris Jobke 2017-12-14 10:45:09 +01:00 committed by GitHub
commit 1f108970c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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'];

View File

@ -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');
}
/**