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>
This commit is contained in:
Roeland Jago Douma 2020-09-08 14:38:36 +02:00
parent 6540c397aa
commit 9fdeed8cc0
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 10 additions and 0 deletions

View 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.