diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-16 23:32:17 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-16 23:32:17 +0200 |
commit | c8f9efeb94b136ed0906cefe946629a091796ff2 (patch) | |
tree | 2253b813965f906553b6a5d78b0dc7277d168812 /lib | |
parent | 3b42ac8eb64c511388049add5ebda9c1c1ca0139 (diff) | |
download | nextcloud-server-c8f9efeb94b136ed0906cefe946629a091796ff2.tar.gz nextcloud-server-c8f9efeb94b136ed0906cefe946629a091796ff2.zip |
etag changes are now propagated up the file tree
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/cache/scanner.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 78cab6ed2da..fdbce0d51fe 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -99,8 +99,10 @@ class Scanner extends BasicEmitter { if ($reuseExisting and $cacheData = $this->cache->get($file)) { // prevent empty etag $etag = $cacheData['etag']; + $propagateETagChange = false; if (empty($etag)) { $etag = $data['etag']; + $propagateETagChange = true; } // only reuse data if the file hasn't explicitly changed @@ -110,6 +112,18 @@ class Scanner extends BasicEmitter { } if ($reuseExisting & self::REUSE_ETAG) { $data['etag'] = $etag; + if ($propagateETagChange) { + $parent = $file; + while ($parent !== '') { + $parent = dirname($parent); + if ($parent === '.') { + $parent = ''; + } + $parentCacheData = $this->cache->get($parent); + $parentCacheData['etag'] = $this->storage->getETag($parent); + $this->cache->put($parent, $parentCacheData); + } + } } } // Only update metadata that has changed |