mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Merge pull request #37534 from Rsplwe/master
Adjust the value of the "max-parts" parameter of the object storage 'ListPart' interface to 1000
This commit is contained in:
commit
45a0fe490c
1 changed files with 18 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue