Return proper watcher if SharedStorage originates from ExternalMount

pull/28787/head
John Molakvoæ 3 years ago committed by GitHub
parent e71ce6f659
commit a79ffaba48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save