Optimise getFileInfo - for mounts, dont fetch again filecache, but reuse sourceRootInfo - #27403
Optimise getFileInfo - for mounts, dont fetch again filecache, but reuse sourceRootInfo#27403mrow4a wants to merge 2 commits into
Conversation
…use sourceRootInfo
|
@mrow4a, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975, @PVince81 and @tanghus to be potential reviewers. |
|
Ok, I see it wont be that easy looking on unit tests |
a3a4551 to
1e1095f
Compare
| throw new Forbidden('No read permissions'); | ||
| } | ||
| $folderContent = $this->fileView->getDirectoryContent($this->path); | ||
| $folderContent = $this->fileView->getDirectoryContent($this->path, '', true); |
There was a problem hiding this comment.
'' doesn't seems to be supported as possible value
There was a problem hiding this comment.
This is default value for this function
| namespace OCA\Files_Sharing; | ||
|
|
||
|
|
||
| interface IShareCache { |
There was a problem hiding this comment.
I'm not sure about adding this new interface.
First, the name seems wrong. There is already a cache interface available, so when I implement this IShareCache I expect to implement the methods for a cache (get, set, remove, etc). Right now we only have a getMetadata method which doesn't fit being a cache by itself.
Second, the getMetadata method usage seems bound to the cache. Does it make sense to implement an isolated getMetadata method? I don't think so.
I think the cleanest option is to create a new interface (ICacheMetadata or something similar) in the OCP namespace that inherit from the public ICache interface (I assume there is such interface) and includes the new getMetadata method. The problem with this solution is that we'll likely need to rewrite these caches.
Another option could be forget this interface and just add the new method.
| } | ||
| $subCache = $subStorage->getCache(''); | ||
| $rootEntry = $subCache->get(''); | ||
| if ($parentReadOnly && $subCache instanceof \OCA\Files_Sharing\IShareCache) { |
There was a problem hiding this comment.
🚫 core shouldn't have any knowledge about specific apps.
| if ($subStorage) { | ||
|
|
||
| $subCache = $subStorage->getCache(''); | ||
| if ($subCache instanceof \OCA\Files_Sharing\IShareCache) { |
|
@jvillafanez This PR is purely experimental, I do not try to revolutionize anything (since the target is for OC10, not OC11), but optimize using existing structure. Problem there is that https://github.com/owncloud/core/blob/master/lib/private/Files/View.php#L1431 The other problem is that https://github.com/owncloud/core/blob/master/lib/private/Files/View.php#L1433 is generaly a free ride, this just extends Cache. The check you mentioned The flag for this PR is Developing, but any feedback is generally most needed, thanks! |
| * @return array | ||
| */ | ||
| public function getMetadata() { | ||
| return $this->formatCacheEntry($this->sourceRootInfo); |
There was a problem hiding this comment.
not sure what you're trying to achieve but something that comes to mind is getSourceCache()->get('')
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Uh oh!
There was an error while loading. Please reload this page.