aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/SharedStorage.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2016-11-17 11:48:29 +0100
committerRobin Appelman <robin@icewind.nl>2016-11-17 14:59:31 +0100
commit30e7c27d860bf67ff37778d00fb812aefa8fefa5 (patch)
tree8287e7b3b57e603e11ad389d19d5c3a6c1cc7a9d /apps/files_sharing/lib/SharedStorage.php
parentde983e61e3660964154d1c7f447ca8a2055cc2d6 (diff)
downloadnextcloud-server-30e7c27d860bf67ff37778d00fb812aefa8fefa5.tar.gz
nextcloud-server-30e7c27d860bf67ff37778d00fb812aefa8fefa5.zip
reuse the known rootinfo in the shared cache when possible
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/lib/SharedStorage.php')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 8362a759135..7002d388d93 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -311,6 +311,9 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
}
public function getCache($path = '', $storage = null) {
+ if ($this->cache) {
+ return $this->cache;
+ }
$this->init();
if (is_null($this->storage) || $this->storage instanceof FailedStorage) {
return new FailedCache(false);
@@ -318,7 +321,8 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
if (!$storage) {
$storage = $this;
}
- return new \OCA\Files_Sharing\Cache($storage, $this->storage, $this->sourceRootInfo);
+ $this->cache = new \OCA\Files_Sharing\Cache($storage, $this->storage, $this->sourceRootInfo);
+ return $this->cache;
}
public function getScanner($path = '', $storage = null) {