]> source.dussan.org Git - nextcloud-server.git/commitdiff
Run stat less often for objectstorages 22729/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 8 Sep 2020 12:38:36 +0000 (14:38 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 8 Sep 2020 12:38:36 +0000 (14:38 +0200)
When we want to get the permissions we now do stat at least 5 times for
each entry. Which is a bit much. Especially since the permssions are all
just in the database already.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
lib/private/Files/ObjectStore/ObjectStoreStorage.php

index faa0342935e9a5118c3b9cf6ab4391d6a40a672e..950840301b046a07d7949a5df545581b7ea6591d 100644 (file)
@@ -227,6 +227,16 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
                }
        }
 
+       public function getPermissions($path) {
+               $stat = $this->stat($path);
+
+               if (is_array($stat) && isset($stat['permissions'])) {
+                       return $stat['permissions'];
+               }
+
+               return parent::getPermissions($path);
+       }
+
        /**
         * Override this method if you need a different unique resource identifier for your object storage implementation.
         * The default implementations just appends the fileId to 'urn:oid:'. Make sure the URN is unique over all users.