Merge pull request #6849 from owncloud/checkupdate-reuse
Reuse the data retrieved from the cache in checkUpdate
This commit is contained in:
commit
92d8db6f19
|
@ -32,7 +32,7 @@ class Shared_Watcher extends Watcher {
|
||||||
* @param string $path
|
* @param string $path
|
||||||
*/
|
*/
|
||||||
public function checkUpdate($path) {
|
public function checkUpdate($path) {
|
||||||
if ($path != '' && parent::checkUpdate($path)) {
|
if ($path != '' && parent::checkUpdate($path) === true) {
|
||||||
// since checkUpdate() has already updated the size of the subdirs,
|
// since checkUpdate() has already updated the size of the subdirs,
|
||||||
// only apply the update to the owner's parent dirs
|
// only apply the update to the owner's parent dirs
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class Watcher {
|
||||||
* check $path for updates
|
* check $path for updates
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @return boolean true if path was updated, false otherwise
|
* @return boolean | array true if path was updated, otherwise the cached data is returned
|
||||||
*/
|
*/
|
||||||
public function checkUpdate($path) {
|
public function checkUpdate($path) {
|
||||||
$cachedEntry = $this->cache->get($path);
|
$cachedEntry = $this->cache->get($path);
|
||||||
|
@ -56,7 +56,7 @@ class Watcher {
|
||||||
$this->cache->correctFolderSize($path);
|
$this->cache->correctFolderSize($path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return $cachedEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -801,6 +801,7 @@ class View {
|
||||||
* @var string $internalPath
|
* @var string $internalPath
|
||||||
*/
|
*/
|
||||||
list($storage, $internalPath) = Filesystem::resolvePath($path);
|
list($storage, $internalPath) = Filesystem::resolvePath($path);
|
||||||
|
$data = null;
|
||||||
if ($storage) {
|
if ($storage) {
|
||||||
$cache = $storage->getCache($internalPath);
|
$cache = $storage->getCache($internalPath);
|
||||||
$permissionsCache = $storage->getPermissionsCache($internalPath);
|
$permissionsCache = $storage->getPermissionsCache($internalPath);
|
||||||
|
@ -811,10 +812,12 @@ class View {
|
||||||
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
|
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
|
||||||
} else {
|
} else {
|
||||||
$watcher = $storage->getWatcher($internalPath);
|
$watcher = $storage->getWatcher($internalPath);
|
||||||
$watcher->checkUpdate($internalPath);
|
$data = $watcher->checkUpdate($internalPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_array($data)) {
|
||||||
$data = $cache->get($internalPath);
|
$data = $cache->get($internalPath);
|
||||||
|
}
|
||||||
|
|
||||||
if ($data and $data['fileid']) {
|
if ($data and $data['fileid']) {
|
||||||
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
|
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
|
||||||
|
|
Loading…
Reference in New Issue