Skip to content
Snippets Groups Projects
Unverified Commit e393b355 authored by Robin Appelman's avatar Robin Appelman
Browse files

set s3 part size to 500mb


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 385d6f09
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ use Aws\S3\MultipartUploader; ...@@ -26,7 +26,7 @@ use Aws\S3\MultipartUploader;
use Aws\S3\S3Client; use Aws\S3\S3Client;
use Psr\Http\Message\StreamInterface; use Psr\Http\Message\StreamInterface;
const S3_UPLOAD_PART_SIZE = 5368709120; const S3_UPLOAD_PART_SIZE = 524288000; // 500MB
trait S3ObjectTrait { trait S3ObjectTrait {
/** /**
...@@ -86,6 +86,7 @@ trait S3ObjectTrait { ...@@ -86,6 +86,7 @@ trait S3ObjectTrait {
$uploader = new MultipartUploader($this->getConnection(), $stream, [ $uploader = new MultipartUploader($this->getConnection(), $stream, [
'bucket' => $this->bucket, 'bucket' => $this->bucket,
'key' => $urn, 'key' => $urn,
'part_size' => S3_UPLOAD_PART_SIZE
]); ]);
$tries = 0; $tries = 0;
...@@ -94,6 +95,7 @@ trait S3ObjectTrait { ...@@ -94,6 +95,7 @@ trait S3ObjectTrait {
try { try {
$result = $uploader->upload(); $result = $uploader->upload();
} catch (MultipartUploadException $e) { } catch (MultipartUploadException $e) {
\OC::$server->getLogger()->logException($e);
rewind($stream); rewind($stream);
$tries++; $tries++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment