diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-01-07 18:13:35 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-01-15 15:36:52 +0100 |
commit | ddbbe1742fda9b508da5c6369dc2a2d5e19cec95 (patch) | |
tree | b69d7c4e73212e7d08cbf40dd8f66d3b85e537c0 /lib/private/files/cache/propagator.php | |
parent | fcec704174a384f93214a1f2b83bed385e763ff6 (diff) | |
download | nextcloud-server-ddbbe1742fda9b508da5c6369dc2a2d5e19cec95.tar.gz nextcloud-server-ddbbe1742fda9b508da5c6369dc2a2d5e19cec95.zip |
propagate folder size in the same query for write updates
Diffstat (limited to 'lib/private/files/cache/propagator.php')
-rw-r--r-- | lib/private/files/cache/propagator.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/files/cache/propagator.php b/lib/private/files/cache/propagator.php index 1e85a2ecc8b..50264e54d44 100644 --- a/lib/private/files/cache/propagator.php +++ b/lib/private/files/cache/propagator.php @@ -43,9 +43,10 @@ class Propagator implements IPropagator { /** * @param string $internalPath * @param int $time - * @return array[] all propagated cache entries + * @param int $sizeDifference number of bytes the file has grown + * @return array[] all propagated entries */ - public function propagateChange($internalPath, $time) { + public function propagateChange($internalPath, $time, $sizeDifference = 0) { $cache = $this->storage->getCache($internalPath); $parentId = $cache->getParentId($internalPath); @@ -58,7 +59,12 @@ class Propagator implements IPropagator { } $mtime = max($time, $entry['mtime']); - $cache->update($parentId, ['mtime' => $mtime, 'etag' => $this->storage->getETag($entry['path'])]); + if ($entry['size'] === -1) { + $newSize = -1; + } else { + $newSize = $entry['size'] + $sizeDifference; + } + $cache->update($parentId, ['mtime' => $mtime, 'etag' => $this->storage->getETag($entry['path']), 'size' => $newSize]); $parentId = $entry['parent']; } |