diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-05 22:06:19 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-12-05 22:06:19 +0100 |
commit | 72f3882d4b405ad8035f795120f6c2e7a3dda174 (patch) | |
tree | 6a8dbd29be4326134de305950800e19fe0613b60 /lib/private/Files/Cache/Propagator.php | |
parent | 1e0339775057201f54c87fb18e329c1fb94f7a60 (diff) | |
download | nextcloud-server-72f3882d4b405ad8035f795120f6c2e7a3dda174.tar.gz nextcloud-server-72f3882d4b405ad8035f795120f6c2e7a3dda174.zip |
No need to propogate changes in appdata
Right now we propogate a lof of changes in appdata. So for example we
propogate each and every preview that is added to the system. This has
no real added value as far as I can tell.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Files/Cache/Propagator.php')
-rw-r--r-- | lib/private/Files/Cache/Propagator.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/Propagator.php b/lib/private/Files/Cache/Propagator.php index ae51b2e52d8..7634029e73f 100644 --- a/lib/private/Files/Cache/Propagator.php +++ b/lib/private/Files/Cache/Propagator.php @@ -46,12 +46,14 @@ class Propagator implements IPropagator { private $connection; /** - * @param \OC\Files\Storage\Storage $storage - * @param IDBConnection $connection + * @var array */ - public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $connection) { + private $ignore = []; + + public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $connection, array $ignore = []) { $this->storage = $storage; $this->connection = $connection; + $this->ignore = $ignore; } @@ -62,6 +64,13 @@ class Propagator implements IPropagator { * @suppress SqlInjectionChecker */ public function propagateChange($internalPath, $time, $sizeDifference = 0) { + // Do not propogate changes in ignored paths + foreach ($this->ignore as $ignore) { + if (strpos($internalPath, $ignore) === 0) { + return; + } + } + $storageId = (int)$this->storage->getStorageCache()->getNumericId(); $parents = $this->getParents($internalPath); |