diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-05-23 14:32:28 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-23 14:32:28 +0200 |
commit | 21df2eb5a1c8b305d953dcc34386da53ec953aee (patch) | |
tree | 654a53e37d01aee7a8c972eb9484c22804b3c480 | |
parent | 68c5df798c237ef3f5ad101eb14612b95fe02e29 (diff) | |
parent | e6386652dfec0bac63b6a96ceaddf5d3318ca0b7 (diff) | |
download | nextcloud-server-21df2eb5a1c8b305d953dcc34386da53ec953aee.tar.gz nextcloud-server-21df2eb5a1c8b305d953dcc34386da53ec953aee.zip |
Merge pull request #24695 from owncloud/background-scan-propagate
Trigger propagation from the background scanner
-rw-r--r-- | lib/private/Files/Utils/Scanner.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php index b013cbecabc..470b12bb44a 100644 --- a/lib/private/Files/Utils/Scanner.php +++ b/lib/private/Files/Utils/Scanner.php @@ -123,8 +123,20 @@ class Scanner extends PublicEmitter { if ($mount->getStorage()->instanceOfStorage('\OC\Files\Storage\Local') && $mount->getMountPoint() === '/') { continue; } - $scanner = $mount->getStorage()->getScanner(); + $storage = $mount->getStorage(); + $scanner = $storage->getScanner(); $this->attachListener($mount); + + $scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function ($path) use ($storage) { + $this->triggerPropagator($storage, $path); + }); + $scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function ($path) use ($storage) { + $this->triggerPropagator($storage, $path); + }); + $scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function ($path) use ($storage) { + $this->triggerPropagator($storage, $path); + }); + $scanner->backgroundScan(); } } |