-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
Use multipartupload for uploading chunks to s3 #2541
Use multipartupload for uploading chunks to s3 #2541
Conversation
@marinofaggiana @tobiasKaminsky Why do we need to specify the chunk size manually inside the apps? On web chunking happens automatically. Also, you have to adjust it constantly if you upload different files. For example I wanted to upload a 20 MB file so I set the chunks to 5MBs, but then I wanted to upload a 20 GB file and I wanted to change them to 1GB. Having this done automatically would be a much better experience. We can still keep the option for manual chunk size as well. @marinofaggiana Second thing, the docs specify that the min chunk is 5MB and the max can be 5GB. Currently, the max in the app is 100MB. Can we increase it? |
What else to add:
|
|
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
+ (void)setChunkSize:(NSInteger)size | ||
{ | ||
if (size < 10) size = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the size should still be default to the minimum supported value of 5MB then if configured to be > 0.
Maybe there is some byte calculation in another place where the 5 MB -> bytes generates the wrong value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this two function and use the new algorithm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment left regarding the chunk size, but tested and works and also verified that the S3 upload mechanism is properly used.
…use-multipartupload-for-uploading-chunks-to-s3-2 Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com> # Conflicts: # Nextcloud.xcodeproj/project.pbxproj
|
||
if (size == nil) { | ||
NSInteger sizeInt = [size integerValue]; | ||
|
||
if (size == nil || sizeInt < 10) { | ||
return 0; | ||
} else { | ||
return [size integerValue]; | ||
} | ||
} | ||
|
||
/// In megabytes (MB) | ||
+ (void)setChunkSize:(NSInteger)size | ||
{ | ||
if (size < 10) size = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int checks are temporary until we add auto chunking
This closes #2471 |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## develop #2541 +/- ##
==========================================
+ Coverage 9.37% 9.92% +0.55%
==========================================
Files 185 185
Lines 26355 26361 +6
Branches 9827 9829 +2
==========================================
+ Hits 2471 2617 +146
+ Misses 23669 23519 -150
- Partials 215 225 +10
☔ View full report in Codecov by Sentry. |
+ (void)setChunkSize:(NSInteger)size | ||
{ | ||
if (size < 10) size = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this two function and use the new algorithm
@marinofaggiana Bad idea since we still have the option in settings to change chunks. I added a new issue that will implement this. I suggest we keep this for now. #2547 |
…use-multipartupload-for-uploading-chunks-to-s3-2 Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com> # Conflicts: # Nextcloud.xcodeproj/project.pbxproj
Docs: nextcloud/documentation#10740
Dependency PR: nextcloud/NextcloudKit#38