mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #58255 from nextcloud/backport/56505/stable31
This commit is contained in:
commit
3c504dce80
1 changed files with 5 additions and 2 deletions
|
|
@ -261,13 +261,16 @@ class AmazonS3 extends Common {
|
|||
// to delete all objects prefixed with the path.
|
||||
do {
|
||||
// instead of the iterator, manually loop over the list ...
|
||||
$objects = $connection->listObjects($params);
|
||||
$objects = $connection->listObjectsV2($params);
|
||||
// ... so we can delete the files in batches
|
||||
if (isset($objects['Contents'])) {
|
||||
$connection->deleteObjects([
|
||||
'Bucket' => $this->bucket,
|
||||
'Delete' => [
|
||||
'Objects' => $objects['Contents']
|
||||
'Objects' => array_map(fn (array $object) => [
|
||||
'ETag' => $object['ETag'],
|
||||
'Key' => $object['Key'],
|
||||
], $objects['Contents'])
|
||||
]
|
||||
]);
|
||||
$this->testTimeout();
|
||||
|
|
|
|||
Loading…
Reference in a new issue