diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-01-01 18:15:07 +0100 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-09-23 14:03:41 +0200 |
commit | 80340a8d463e2d115ed1c33c0f0f54542f3e952e (patch) | |
tree | bc0b202ffaac895e7d4826cd576ea9e412f25253 /apps/files_external/lib | |
parent | 12863e0d243bb72057f1a005a0b319910f4da8c5 (diff) | |
download | nextcloud-server-80340a8d463e2d115ed1c33c0f0f54542f3e952e.tar.gz nextcloud-server-80340a8d463e2d115ed1c33c0f0f54542f3e952e.zip |
Fill directory cache from opendir
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 4 |
1 files changed, 3 insertions, 1 deletions
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'])) { |