From 30e7c27d860bf67ff37778d00fb812aefa8fefa5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 17 Nov 2016 11:48:29 +0100 Subject: reuse the known rootinfo in the shared cache when possible Signed-off-by: Robin Appelman --- apps/files_sharing/lib/SharedStorage.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps/files_sharing/lib/SharedStorage.php') 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) { -- cgit v1.2.3