From 412b5c5407c936eb768554685c3c7fab87389c23 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 18 Jul 2016 11:35:14 +0200 Subject: Store the shared propagator instance This instead of recreating it for every call. --- apps/files_sharing/lib/sharedstorage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 8e9a0f41229..92900ccda69 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -319,10 +319,15 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage { } public function getPropagator($storage = null) { + if (isset($this->propagator)) { + return $this->propagator; + } + if (!$storage) { $storage = $this; } - return new \OCA\Files_Sharing\SharedPropagator($storage, \OC::$server->getDatabaseConnection()); + $this->propagator = new \OCA\Files_Sharing\SharedPropagator($storage, \OC::$server->getDatabaseConnection()); + return $this->propagator; } public function getOwner($path) { -- cgit v1.2.3