mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
Cache fetched apps in update check
The code tried to find the apps with updates and thus was called for every available app. This caused to get the full appstore content as often as apps are available. The appstore request itself was cached nevertheless in an appdata dir, but with an object storage this is still a lot of round trips to read this cached result. Thus the instantiated list is now cached in a static variable (because it's a static method call). Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
3a6d16e6d4
commit
a97a290fd5
1 changed files with 5 additions and 1 deletions
|
|
@ -395,7 +395,11 @@ class Installer {
|
|||
return false;
|
||||
}
|
||||
|
||||
$apps = $appFetcher->get();
|
||||
static $apps = null;
|
||||
if ($apps === null) {
|
||||
$apps = $appFetcher->get();
|
||||
}
|
||||
|
||||
foreach($apps as $app) {
|
||||
if($app['id'] === $appId) {
|
||||
$currentVersion = OC_App::getAppVersion($appId);
|
||||
|
|
|
|||
Loading…
Reference in a new issue