Skip to content
Snippets Groups Projects
Commit 77f12c52 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Update etags in parent folders

parent 83064aca
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ class Updater { ...@@ -34,6 +34,7 @@ class Updater {
$scanner = new Scanner($storage); $scanner = new Scanner($storage);
$scanner->scan($internalPath, Scanner::SCAN_SHALLOW); $scanner->scan($internalPath, Scanner::SCAN_SHALLOW);
$cache->correctFolderSize($internalPath); $cache->correctFolderSize($internalPath);
self::eTagUpdate($path);
} }
static public function deleteUpdate($path) { static public function deleteUpdate($path) {
...@@ -45,6 +46,29 @@ class Updater { ...@@ -45,6 +46,29 @@ class Updater {
$cache = new Cache($storage); $cache = new Cache($storage);
$cache->remove($internalPath); $cache->remove($internalPath);
$cache->correctFolderSize($internalPath); $cache->correctFolderSize($internalPath);
self::eTagUpdate($path);
}
static public function eTagUpdate($path) {
if ($path !== '') {
$parent = dirname($path);
if ($parent === '.') {
$parent = '';
}
/**
* @var \OC\Files\Storage\Storage $storage
* @var string $internalPath
*/
list($storage, $internalPath) = self::resolvePath($parent);
if ($storage) {
$cache = $storage->getCache();
$id = $cache->getId($internalPath);
if ($id !== -1) {
$cache->update($id, array('etag' => $storage->getETag($internalPath)));
self::updateFolderETags($parent);
}
}
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment