Return proper watcher if SharedStorage originates from ExternalMount

This commit is contained in:
John Molakvoæ 2021-09-10 15:27:37 +02:00 committed by GitHub
parent a83f42cf43
commit 71c2456e3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -402,7 +402,20 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
return $this->superShare->getShareOwner();
}
public function getWatcher($path = '', $storage = null) {
public function getWatcher($path = '', $storage = null): Watcher {
$mountManager = \OC::$server->getMountManager();
// Get node informations
$node = $this->getShare()->getNodeCacheEntry();
if ($node) {
$mount = $mountManager->findByNumericId($node->getStorageId());
// If the share is originating from an external storage
if (count($mount) > 0 && $mount[0] instanceof ExternalMountPoint) {
// Propagate original storage scan
return parent::getWatcher($path, $storage);
}
}
// cache updating is handled by the share source
return new NullWatcher();
}