Use cached app list

Followup to #7264

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2017-12-14 09:50:17 +01:00
parent ce12763ab7
commit 54c227b6c4
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
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');
}
/**