summaryrefslogtreecommitdiffstats
path: root/lib/files
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-05-29 10:19:03 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-05-29 10:19:03 -0400
commit04805d0be9add28f0b374df01ca4211a997d21d0 (patch)
tree667e21d37f4223ada7a3e8fa9c0963fcfcd0f133 /lib/files
parentfee43ec506ee423f67ddae0a9ef29a3135b99ab6 (diff)
downloadnextcloud-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.php11
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;
}