mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 08:16:43 -04:00
The storage is not static anymore
Don't call twice $cache->getId Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
31fb8d0c71
commit
a735773d71
1 changed files with 11 additions and 15 deletions
|
|
@ -135,22 +135,18 @@ class FileSystemTags implements ICheck, IFileCheck {
|
|||
protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
|
||||
/** @psalm-suppress InvalidArgument */
|
||||
if ($this->storage->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class)) {
|
||||
static $groupFolderStorage = null;
|
||||
if ($groupFolderStorage === null) {
|
||||
// Special implementation for groupfolder since all groupfolder chare the same storage
|
||||
// so add the group folder id in the cache key too.
|
||||
$groupFolderStorage = $this->storage;
|
||||
$groupFolderStoragClass = \OCA\GroupFolders\Mount\GroupFolderStorage::class;
|
||||
while ($groupFolderStorage->instanceOfStorage(Wrapper::class)) {
|
||||
if ($groupFolderStorage instanceof $groupFolderStoragClass) {
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* @var Wrapper $sourceStorage
|
||||
*/
|
||||
$groupFolderStorage = $groupFolderStorage->getWrapperStorage();
|
||||
// Special implementation for groupfolder since all groupfolders share the same storage
|
||||
// id so add the group folder id in the cache key too.
|
||||
$groupFolderStorage = $this->storage;
|
||||
$groupFolderStorageClass = \OCA\GroupFolders\Mount\GroupFolderStorage::class;
|
||||
while ($groupFolderStorage->instanceOfStorage(Wrapper::class)) {
|
||||
if ($groupFolderStorage instanceof $groupFolderStorageClass) {
|
||||
break;
|
||||
}
|
||||
/** @var Wrapper $groupFolderStorage */
|
||||
$groupFolderStorage = $groupFolderStorage->getWrapperStorage();
|
||||
}
|
||||
/** @psalm-suppress UndefinedMethod */
|
||||
$cacheId = $cache->getNumericStorageId() . '/' . $groupFolderStorage->getFolderId();
|
||||
} else {
|
||||
$cacheId = $cache->getNumericStorageId();
|
||||
|
|
@ -168,7 +164,7 @@ class FileSystemTags implements ICheck, IFileCheck {
|
|||
|
||||
$fileId = $cache->getId($path);
|
||||
if ($fileId !== -1) {
|
||||
$parentIds[] = $cache->getId($path);
|
||||
$parentIds[] = $fileId;
|
||||
}
|
||||
|
||||
$this->fileIds[$cacheId][$path] = $parentIds;
|
||||
|
|
|
|||
Loading…
Reference in a new issue