From: Alexander Ebert Date: Thu, 1 Aug 2013 15:55:17 +0000 (+0200) Subject: Resetting update cache once package lists have been updated X-Git-Tag: 2.0.0_Beta_7~68^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3aa69672637ac704ef2a5f9e273f2830922170f8;p=GitHub%2FWoltLab%2FWCF.git Resetting update cache once package lists have been updated --- diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 78a6bf825e..1af7d9cd05 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -7,6 +7,7 @@ use wcf\data\package\update\version\PackageUpdateVersionList; use wcf\data\package\update\PackageUpdateEditor; use wcf\data\package\update\PackageUpdateList; use wcf\data\package\Package; +use wcf\system\cache\builder\PackageUpdateCacheBuilder; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\HTTPUnauthorizedException; use wcf\system\exception\SystemException; @@ -38,10 +39,12 @@ class PackageUpdateDispatcher extends SingletonFactory { $updateServers = PackageUpdateServer::getActiveUpdateServers($packageUpdateServerIDs); // loop servers + $refreshedPackageLists = false; foreach ($updateServers as $updateServer) { if ($updateServer->lastUpdateTime < TIME_NOW - 600) { try { $this->getPackageUpdateXML($updateServer); + $refreshedPackageLists = true; } catch (SystemException $e) { // save error status @@ -53,6 +56,10 @@ class PackageUpdateDispatcher extends SingletonFactory { } } } + + if ($refreshedPackageLists) { + PackageUpdateCacheBuilder::getInstance()->reset(); + } } /**