diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-06-14 17:17:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-06-14 17:17:43 +0200 |
commit | 01d9ad6b14bc5d9fd6c1140e801e92167b0c7f6a (patch) | |
tree | 1c4a09ee1b32888aa05b00d3a5d3fbb1e7d9be2a | |
parent | dfcaeeabb3b69888d993c29016a5e8d4a0aa7569 (diff) | |
download | nextcloud-server-01d9ad6b14bc5d9fd6c1140e801e92167b0c7f6a.tar.gz nextcloud-server-01d9ad6b14bc5d9fd6c1140e801e92167b0c7f6a.zip |
optimized size propagation on deletes
-rw-r--r-- | lib/private/Files/Cache/Updater.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php index 4e17c4d778d..361db4b3f85 100644 --- a/lib/private/Files/Cache/Updater.php +++ b/lib/private/Files/Cache/Updater.php @@ -25,6 +25,8 @@ */ namespace OC\Files\Cache; + +use OCP\Files\Cache\ICacheEntry; use OCP\Files\Cache\IUpdater; use OCP\Files\Storage\IStorage; @@ -150,12 +152,20 @@ class Updater implements IUpdater { $parent = ''; } + $entry = $this->cache->get($path); + $this->cache->remove($path); - if ($this->cache instanceof Cache) { - $this->cache->correctFolderSize($parent); - } + $this->correctParentStorageMtime($path); - $this->propagator->propagateChange($path, time()); + if ($entry instanceof ICacheEntry) { + $this->propagator->propagateChange($path, time(), -$entry->getSize()); + } else { + $this->propagator->propagateChange($path, time()); + if ($this->cache instanceof Cache) { + $this->cache->correctFolderSize($parent); + } + } + } /** |