diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-07-15 18:26:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 18:26:48 +0200 |
commit | 638e9438a937c5f81b374ec3f1db2872215290ae (patch) | |
tree | 28c8185219a8dd7c1a8603668b86afce087f0574 /apps/files_external/lib/Lib | |
parent | e27f8aa3e5adc23ecf26c3ae5500ae8ce741e190 (diff) | |
parent | f5cc34c9c202eccf0a3cda95fc74e077dc49d80c (diff) | |
download | nextcloud-server-638e9438a937c5f81b374ec3f1db2872215290ae.tar.gz nextcloud-server-638e9438a937c5f81b374ec3f1db2872215290ae.zip |
Merge pull request #21728 from nextcloud/bugfix/noid/s3-external-mtime-cache
Reuse cache for directory mtime/size if filesystem changes can be ignored
Diffstat (limited to 'apps/files_external/lib/Lib')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 641a26b20ee..4a49f70dd58 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -45,6 +45,7 @@ use Aws\S3\S3Client; use Icewind\Streams\CallbackWrapper; use Icewind\Streams\IteratorDirectory; use OC\Cache\CappedMemoryCache; +use OC\Files\Cache\CacheEntry; use OC\Files\ObjectStore\S3ConnectionTrait; use OC\Files\ObjectStore\S3ObjectTrait; use OCP\Constants; @@ -374,6 +375,11 @@ class AmazonS3 extends \OC\Files\Storage\Common { //folders don't really exist $stat['size'] = -1; //unknown $stat['mtime'] = time(); + $cacheEntry = $this->getCache()->get($path); + if ($cacheEntry instanceof CacheEntry && $this->getMountOption('filesystem_check_changes', 1) !== 1) { + $stat['size'] = $cacheEntry->getSize(); + $stat['mtime'] = $cacheEntry->getMTime(); + } } else { $stat['size'] = $this->getContentLength($path); $stat['mtime'] = strtotime($this->getLastModified($path)); |