summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-15 11:58:50 +0200
committerGitHub <noreply@github.com>2016-06-15 11:58:50 +0200
commitf163eedfa281099c8ef63ea8e4da138a47228283 (patch)
treeff43b8cf2d0841addd2a040f70ce489cabf3cd52 /lib/private/Files
parent3e9353dd699b4ed9a568bfbf30e115da422f7447 (diff)
parent01d9ad6b14bc5d9fd6c1140e801e92167b0c7f6a (diff)
downloadnextcloud-server-f163eedfa281099c8ef63ea8e4da138a47228283.tar.gz
nextcloud-server-f163eedfa281099c8ef63ea8e4da138a47228283.zip
Merge pull request #25102 from owncloud/preview-delete-performance
Preview delete performance
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Cache/Updater.php18
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);
+ }
+ }
+
}
/**