diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-05-02 09:15:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 09:15:35 +0200 |
commit | 81ee0673a51ae2fe0a0b14420dce9e7337eb1425 (patch) | |
tree | 9551698390cb6ea97b01059c509bed7e775fd140 /lib | |
parent | f27d382c4775d1a47ca8d81a987fd82b79cf05c9 (diff) | |
parent | aa4cebe7495d496c695a23ba7eed5d19d306db51 (diff) | |
download | nextcloud-server-81ee0673a51ae2fe0a0b14420dce9e7337eb1425.tar.gz nextcloud-server-81ee0673a51ae2fe0a0b14420dce9e7337eb1425.zip |
Merge pull request #4650 from nextcloud/appcache_on_updatev12.0.0beta1
Do not use caching for appstore fetchers after upgrade
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/Fetcher.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php index ab0e299f0a2..bde925b745f 100644 --- a/lib/private/App/AppStore/Fetcher/Fetcher.php +++ b/lib/private/App/AppStore/Fetcher/Fetcher.php @@ -125,19 +125,19 @@ abstract class Fetcher { $file = $rootFolder->getFile($this->fileName); $jsonBlob = json_decode($file->getContent(), true); if (is_array($jsonBlob)) { - /* - * If the timestamp is older than 300 seconds request the files new - * If the version changed (update!) also refresh - */ - if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) && - isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0') - ) { - return $jsonBlob['data']; - } - if (isset($jsonBlob['ETag'])) { - $ETag = $jsonBlob['ETag']; - $content = json_encode($jsonBlob['data']); + // No caching when the version has been updated + if (isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')) { + + // If the timestamp is older than 300 seconds request the files new + if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS)) { + return $jsonBlob['data']; + } + + if (isset($jsonBlob['ETag'])) { + $ETag = $jsonBlob['ETag']; + $content = json_encode($jsonBlob['data']); + } } } } catch (NotFoundException $e) { |