From cbcbbd9423c72f1aa9efb5c6e2a8cda99e510a4c Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 4 Sep 2015 16:17:27 +0200 Subject: Avoid re-propagation of shares during one propagation run * fix was proposed by @nickvergessen --- apps/files_sharing/lib/propagation/recipientpropagator.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps') diff --git a/apps/files_sharing/lib/propagation/recipientpropagator.php b/apps/files_sharing/lib/propagation/recipientpropagator.php index 11764106861..420cacb3d2f 100644 --- a/apps/files_sharing/lib/propagation/recipientpropagator.php +++ b/apps/files_sharing/lib/propagation/recipientpropagator.php @@ -126,7 +126,13 @@ class RecipientPropagator { }); } + protected $propagatingIds = []; + public function propagateById($id) { + if (isset($this->propagatingIds[$id])) { + return; + } + $this->propagatingIds[$id] = true; $shares = Share::getAllSharesForFileId($id); foreach ($shares as $share) { // propagate down the share tree @@ -141,5 +147,7 @@ class RecipientPropagator { $watcher->writeHook(['path' => $path]); } } + + unset($this->propagatingIds[$id]); } } -- cgit v1.2.3