From d7742c1504566f298d0ef3b49c3a46d571170899 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Tue, 1 Jan 2019 18:15:07 +0100 Subject: [PATCH] Fill directory cache from opendir Signed-off-by: Daniel Kesselberg --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index b48c3fbfd83..019bfa17b3c 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -60,6 +60,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { /** @var CappedMemoryCache|Result[] */ private $objectCache; + /** @var CappedMemoryCache|bool[] */ private $directoryCache; @@ -114,7 +115,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { unset($this->objectCache[$existingKey]); } } - unset($this->filesCache[$key]); + unset($this->directoryCache[$key], $this->filesCache[$key]); } /** @@ -334,6 +335,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { if (is_array($result['CommonPrefixes'])) { foreach ($result['CommonPrefixes'] as $prefix) { $files[] = substr(trim($prefix['Prefix'], '/'), strlen($path)); + $this->directoryCache[substr(trim($prefix['Prefix'], '/'), strlen($path))] = true; } } if (is_array($result['Contents'])) { -- 2.39.5