diff options
author | Simon L <szaimen@e.mail.de> | 2023-04-18 00:16:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 00:16:38 +0200 |
commit | 45a0fe490c48ad5be1bd93e4ef8bb37cc9706b77 (patch) | |
tree | bfbc7e65fab2d83e65abcba5eb51fc7e800b8381 /lib/private/Files/ObjectStore | |
parent | 5952a027c39eaa414455be6a21fdb0b0de7cc9da (diff) | |
parent | 5c6f35832c3585d4bd021dc2025243023da230bc (diff) | |
download | nextcloud-server-45a0fe490c48ad5be1bd93e4ef8bb37cc9706b77.tar.gz nextcloud-server-45a0fe490c48ad5be1bd93e4ef8bb37cc9706b77.zip |
Merge pull request #37534 from Rsplwe/master
Adjust the value of the "max-parts" parameter of the object storage 'ListPart' interface to 1000
Diffstat (limited to 'lib/private/Files/ObjectStore')
-rw-r--r-- | lib/private/Files/ObjectStore/S3.php | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/private/Files/ObjectStore/S3.php b/lib/private/Files/ObjectStore/S3.php index ebc8886f12d..76eee2bc962 100644 --- a/lib/private/Files/ObjectStore/S3.php +++ b/lib/private/Files/ObjectStore/S3.php @@ -69,13 +69,24 @@ class S3 implements IObjectStore, IObjectStoreMultiPartUpload { } public function getMultipartUploads(string $urn, string $uploadId): array { - $parts = $this->getConnection()->listParts([ - 'Bucket' => $this->bucket, - 'Key' => $urn, - 'UploadId' => $uploadId, - 'MaxParts' => 10000 - ]); - return $parts->get('Parts') ?? []; + $parts = []; + $isTruncated = true; + $partNumberMarker = 0; + + while ($isTruncated) { + $result = $this->getConnection()->listParts([ + 'Bucket' => $this->bucket, + 'Key' => $urn, + 'UploadId' => $uploadId, + 'MaxParts' => 1000, + 'PartNumberMarker' => $partNumberMarker + ]); + $parts = array_merge($parts, $result->get('Parts') ?? []); + $isTruncated = $result->get('IsTruncated'); + $partNumberMarker = $result->get('NextPartNumberMarker'); + } + + return $parts; } public function completeMultipartUpload(string $urn, string $uploadId, array $result): int { |