From e6386652dfec0bac63b6a96ceaddf5d3318ca0b7 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 18 May 2016 14:31:43 +0200 Subject: Trigger propagation from the background scanner --- lib/private/Files/Utils/Scanner.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') 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(); } } -- cgit v1.2.3