diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-29 10:19:03 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-29 10:19:03 -0400 |
commit | 04805d0be9add28f0b374df01ca4211a997d21d0 (patch) | |
tree | 667e21d37f4223ada7a3e8fa9c0963fcfcd0f133 /lib/files | |
parent | fee43ec506ee423f67ddae0a9ef29a3135b99ab6 (diff) | |
download | nextcloud-server-04805d0be9add28f0b374df01ca4211a997d21d0.tar.gz nextcloud-server-04805d0be9add28f0b374df01ca4211a997d21d0.zip |
Only update metadata that has changed
Diffstat (limited to 'lib/files')
-rw-r--r-- | lib/files/cache/scanner.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php index 46122221dc2..cd022d25132 100644 --- a/lib/files/cache/scanner.php +++ b/lib/files/cache/scanner.php @@ -78,7 +78,7 @@ class Scanner { $this->scanFile($parent); } } - if($cacheData = $this->cache->get($file)) { + if ($cacheData = $this->cache->get($file)) { if ($data['mtime'] === $cacheData['mtime'] && $data['size'] === $cacheData['size']) { $data['etag'] = $cacheData['etag']; @@ -89,7 +89,14 @@ class Scanner { $data['size'] = $cacheData['size']; } } - $this->cache->put($file, $data); + $newData = $data; + if ($cacheData) { + // Only update metadata that has changed + $newData = array_diff($data, $cacheData); + } + if (!empty($newData)) { + $this->cache->put($file, $newData); + } } return $data; } |