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>
pull/7264/head
Morris Jobke 8 years ago
parent 3a6d16e6d4
commit a97a290fd5
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
  1. 6
      lib/private/Installer.php

@ -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…
Cancel
Save