]> source.dussan.org Git - nextcloud-server.git/commitdiff
Port away from deprecated clearBucket call
authorCarl Schwan <carl@carlschwan.eu>
Sun, 16 Oct 2022 21:39:49 +0000 (23:39 +0200)
committerCarl Schwan <carl@carlschwan.eu>
Sun, 16 Oct 2022 21:39:49 +0000 (23:39 +0200)
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>
apps/files_external/lib/Lib/Storage/AmazonS3.php

index f5bb7eb5f0605dc7be589710bacba95360aa484f..1b3d2e6936fac9268e6cca2fc5eceb80c539787c 100644 (file)
@@ -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
                ];