Merge pull request #24695 from owncloud/background-scan-propagate

Trigger propagation from the background scanner
This commit is contained in:
Vincent Petry 2016-05-23 14:32:28 +02:00
commit 21df2eb5a1
1 changed files with 13 additions and 1 deletions

View File

@ -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();
}
}