Skip to content
Snippets Groups Projects
Commit 4c056618 authored by Robin Appelman's avatar Robin Appelman
Browse files

Merge branch 'filesystem' of github.com:owncloud/core into filesystem

parents 83d62213 664f33a2
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ class Updater { ...@@ -35,7 +35,7 @@ class Updater {
$scanner = $storage->getScanner($internalPath); $scanner = $storage->getScanner($internalPath);
$scanner->scan($internalPath, Scanner::SCAN_SHALLOW); $scanner->scan($internalPath, Scanner::SCAN_SHALLOW);
$cache->correctFolderSize($internalPath); $cache->correctFolderSize($internalPath);
self::eTagUpdate($path); self::correctFolder($path, $storage->filemtime($internalPath));
} }
} }
...@@ -49,11 +49,17 @@ class Updater { ...@@ -49,11 +49,17 @@ class Updater {
$cache = $storage->getCache($internalPath); $cache = $storage->getCache($internalPath);
$cache->remove($internalPath); $cache->remove($internalPath);
$cache->correctFolderSize($internalPath); $cache->correctFolderSize($internalPath);
self::eTagUpdate($path); self::correctFolder($path, time());
} }
} }
static public function eTagUpdate($path) { /**
* Update the mtime and ETag of all parent folders
*
* @param string $path
* @param string $time
*/
static public function correctFolder($path, $time) {
if ($path !== '' && $path !== '/') { if ($path !== '' && $path !== '/') {
$parent = dirname($path); $parent = dirname($path);
if ($parent === '.') { if ($parent === '.') {
...@@ -68,8 +74,8 @@ class Updater { ...@@ -68,8 +74,8 @@ class Updater {
$cache = $storage->getCache(); $cache = $storage->getCache();
$id = $cache->getId($internalPath); $id = $cache->getId($internalPath);
if ($id !== -1) { if ($id !== -1) {
$cache->update($id, array('etag' => $storage->getETag($internalPath))); $cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath)));
self::eTagUpdate($parent); self::correctFolder($parent, $time);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment