From 733d4b6ccaeec30f931c23614b98013a1b2f674e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 25 Sep 2019 18:07:32 +0200 Subject: dont delete cache entries if deleting an object from object store failed Signed-off-by: Robin Appelman --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index fbfbcfaa409..80f438d762c 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -161,7 +161,9 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { return false; } - $this->rmObjects($path); + if (!$this->rmObjects($path)) { + return false; + } $this->getCache()->remove($path); @@ -172,11 +174,17 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { $children = $this->getCache()->getFolderContents($path); foreach ($children as $child) { if ($child['mimetype'] === 'httpd/unix-directory') { - $this->rmObjects($child['path']); + if (!$this->rmObjects($child['path'])) { + return false; + } } else { - $this->unlink($child['path']); + if(!$this->unlink($child['path'])) { + return false; + } } } + + return true; } public function unlink($path) { -- cgit v1.2.3