From cf1381a6f995fb2196a37253dd46dbf6d34a920a Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sun, 16 Oct 2022 23:39:49 +0200 Subject: [PATCH] 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 --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index f5bb7eb5f06..1b3d2e6936f 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -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 ]; -- 2.39.5