Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the fileid from copyFromCache and use it instead of doing an extra query #26013

Merged
merged 4 commits into from
Mar 16, 2021

Conversation

icewind1991
Copy link
Member

Also move the existing copyFromCache code around and expose it trough the public interface.

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Mar 8, 2021
@icewind1991 icewind1991 added this to the Nextcloud 22 milestone Mar 8, 2021
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't test but the code makes sense!

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks fine, see comments if applicable

$folderContent = $sourceCache->getFolderContentsById($sourceEntry->getId());
foreach ($folderContent as $subEntry) {
$subTargetPath = $targetPath . '/' . $subEntry->getName();
$this->copyFromCache($sourceCache, $subEntry, $subTargetPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we're not afraid of very deep folder structures and stack overflows ?

Edit: just saw it's old copied code, but something to keep in mind as tech debt?

lib/private/Files/Cache/Cache.php Show resolved Hide resolved
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@PVince81
Copy link
Member

build restarted...

@PVince81 PVince81 added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 15, 2021
@icewind1991 icewind1991 merged commit f1e2fb4 into master Mar 16, 2021
@icewind1991 icewind1991 deleted the object-store-copy-cache-id branch March 16, 2021 16:11
@icewind1991
Copy link
Member Author

/backport to stable21

@icewind1991
Copy link
Member Author

/backport to stable20

@icewind1991
Copy link
Member Author

/backport to stable19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants