summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-09-08 14:38:36 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2020-09-08 14:38:36 +0200
commit9fdeed8cc063874bd46598e3134d9f90b9cbd7aa (patch)
treed7ea7edaf22784a1af811cc688d53390fab62a81 /lib
parent6540c397aa3e60d75dcb4aa22bd10437b496cd5d (diff)
downloadnextcloud-server-9fdeed8cc063874bd46598e3134d9f90b9cbd7aa.tar.gz
nextcloud-server-9fdeed8cc063874bd46598e3134d9f90b9cbd7aa.zip
Run stat less often for objectstorages
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreStorage.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index faa0342935e..950840301b0 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -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.