mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 03:50:37 -05:00
Merge pull request #28785 from nextcloud/backport/28377/stable22
[stable22] Scan the shared external storage source on access
This commit is contained in:
commit
8eb921c60e
1 changed files with 16 additions and 1 deletions
|
|
@ -34,10 +34,12 @@ namespace OCA\Files_Sharing;
|
|||
|
||||
use OC\Files\Cache\FailedCache;
|
||||
use OC\Files\Cache\NullWatcher;
|
||||
use OC\Files\Cache\Watcher;
|
||||
use OC\Files\Filesystem;
|
||||
use OC\Files\Storage\FailedStorage;
|
||||
use OC\Files\Storage\Wrapper\PermissionsMask;
|
||||
use OC\User\NoUserException;
|
||||
use OCA\Files_External\Config\ExternalMountPoint;
|
||||
use OCP\Constants;
|
||||
use OCP\Files\Cache\ICacheEntry;
|
||||
use OCP\Files\NotFoundException;
|
||||
|
|
@ -405,7 +407,20 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
|
|||
return $this->superShare->getShareOwner();
|
||||
}
|
||||
|
||||
public function getWatcher($path = '', $storage = null): NullWatcher {
|
||||
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…
Reference in a new issue