Use cached app list
Followup to #7264 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
ce12763ab7
commit
54c227b6c4
2 changed files with 3 additions and 2 deletions
|
@ -396,10 +396,10 @@ class Installer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->apps === null) {
|
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) {
|
if($app['id'] === $appId) {
|
||||||
$currentVersion = OC_App::getAppVersion($appId);
|
$currentVersion = OC_App::getAppVersion($appId);
|
||||||
$newestVersion = $app['releases'][0]['version'];
|
$newestVersion = $app['releases'][0]['version'];
|
||||||
|
|
|
@ -156,6 +156,7 @@ class InstallerTest extends TestCase {
|
||||||
|
|
||||||
$installer = $this->getInstaller();
|
$installer = $this->getInstaller();
|
||||||
$this->assertSame($updateAvailable, $installer->isUpdateAvailable('files'));
|
$this->assertSame($updateAvailable, $installer->isUpdateAvailable('files'));
|
||||||
|
$this->assertSame($updateAvailable, $installer->isUpdateAvailable('files'), 'Cached result should be returned and fetcher should be only called once');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue