mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 07:39:23 -04:00
Port away from deprecated clearBucket call
This was removed a long time ago in the library that we use, but never detected since this was inside a try catch block... Remove the call for now and we should investigate newer api in the future. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
1d90f84141
commit
cf1381a6f9
1 changed files with 2 additions and 9 deletions
|
|
@ -293,18 +293,11 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
|
||||
protected function clearBucket() {
|
||||
$this->clearCache();
|
||||
try {
|
||||
$this->getConnection()->clearBucket([
|
||||
"Bucket" => $this->bucket
|
||||
]);
|
||||
return true;
|
||||
// clearBucket() is not working with Ceph, so if it fails we try the slower approach
|
||||
} catch (\Exception $e) {
|
||||
return $this->batchDelete();
|
||||
}
|
||||
return $this->batchDelete();
|
||||
}
|
||||
|
||||
private function batchDelete($path = null) {
|
||||
// TODO explore using https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.BatchDelete.html
|
||||
$params = [
|
||||
'Bucket' => $this->bucket
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue