Merge pull request #3515 from nextcloud/revert-3214-cache-storage-info

Revert "cache the storage info for 5 min"
This commit is contained in:
Morris Jobke 2017-02-16 12:02:06 -06:00 committed by GitHub
commit 2dfc8d1f46
1 changed files with 5 additions and 29 deletions

View File

@ -52,7 +52,6 @@ class OC_Helper {
/** /**
* Creates an absolute url for public use * Creates an absolute url for public use
*
* @param string $service id * @param string $service id
* @param bool $add_slash * @param bool $add_slash
* @return string the url * @return string the url
@ -70,7 +69,6 @@ class OC_Helper {
/** /**
* Make a human file size * Make a human file size
*
* @param int $bytes file size in bytes * @param int $bytes file size in bytes
* @return string a human readable file size * @return string a human readable file size
* *
@ -106,7 +104,6 @@ class OC_Helper {
/** /**
* Make a php file size * Make a php file size
*
* @param int $bytes file size in bytes * @param int $bytes file size in bytes
* @return string a php parseable file size * @return string a php parseable file size
* *
@ -133,7 +130,6 @@ class OC_Helper {
/** /**
* Make a computer file size * Make a computer file size
*
* @param string $str file size in human readable format * @param string $str file size in human readable format
* @return float a file size in bytes * @return float a file size in bytes
* *
@ -176,7 +172,6 @@ class OC_Helper {
/** /**
* Recursive copying of folders * Recursive copying of folders
*
* @param string $src source folder * @param string $src source folder
* @param string $dest target folder * @param string $dest target folder
* *
@ -199,7 +194,6 @@ class OC_Helper {
/** /**
* Recursive deletion of folders * Recursive deletion of folders
*
* @param string $dir path to the folder * @param string $dir path to the folder
* @param bool $deleteSelf if set to false only the content of the folder will be deleted * @param bool $deleteSelf if set to false only the content of the folder will be deleted
* @return bool * @return bool
@ -399,7 +393,6 @@ class OC_Helper {
/** /**
* performs a search in a nested array * performs a search in a nested array
*
* @param array $haystack the array to be searched * @param array $haystack the array to be searched
* @param string $needle the search string * @param string $needle the search string
* @param string $index optional, only search this key name * @param string $index optional, only search this key name
@ -540,12 +533,6 @@ class OC_Helper {
* @throws \OCP\Files\NotFoundException * @throws \OCP\Files\NotFoundException
*/ */
public static function getStorageInfo($path, $rootInfo = null) { public static function getStorageInfo($path, $rootInfo = null) {
$memcache = \OC::$server->getMemCacheFactory()->create('storageInfo');
$cacheKey = $rootInfo ? '__root__' . md5($path) : md5($path);
$cached = $memcache->get($cacheKey);
if (is_array($cached)) {
return $cached;
}
// return storage info without adding mount points // return storage info without adding mount points
$includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false); $includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false);
@ -614,16 +601,6 @@ class OC_Helper {
$ownerDisplayName = $owner->getDisplayName(); $ownerDisplayName = $owner->getDisplayName();
} }
$memcache->set($cacheKey, [
'free' => $free,
'used' => $used,
'quota' => $quota,
'total' => $total,
'relative' => $relative,
'owner' => $ownerId,
'ownerDisplayName' => $ownerDisplayName,
], 5 * 60);
return [ return [
'free' => $free, 'free' => $free,
'used' => $used, 'used' => $used,
@ -668,7 +645,6 @@ class OC_Helper {
/** /**
* Returns whether the config file is set manually to read-only * Returns whether the config file is set manually to read-only
*
* @return bool * @return bool
*/ */
public static function isReadOnlyConfigEnabled() { public static function isReadOnlyConfigEnabled() {