summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-06-13 11:46:05 +0200
committerGitHub <noreply@github.com>2023-06-13 11:46:05 +0200
commit794bf5b6b96adff7647e00da6018db2205991d33 (patch)
treed3a7ed74b1a085f13133233984a15e5aea047f5f /lib
parenteb99de007dbfb96d60fad7edb898f73290b7b1a8 (diff)
parentdbc7d3ae7c97d624e5ad3e1e58f59b911991c79b (diff)
downloadnextcloud-server-794bf5b6b96adff7647e00da6018db2205991d33.tar.gz
nextcloud-server-794bf5b6b96adff7647e00da6018db2205991d33.zip
Merge pull request #37776 from nextcloud/backport/37534/stable26
[stable26] Adjust the value of the "max-parts" parameter of the object storage 'ListPart' interface to 1000
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/S3.php25
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 {