aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-08-20 15:33:02 +0200
committerGitHub <noreply@github.com>2021-08-20 15:33:02 +0200
commit041fbdad7a89107da30cbada14f1a647039d0d06 (patch)
treeb4be603f79bfc08ddf6aab945b6f97b4a4b8fa8e
parent83d46efefdb591aeb5505a8baec2b9736287de5e (diff)
parent735fd94cc05ae651eea0d9d62bb7afc3b360033f (diff)
downloadnextcloud-server-041fbdad7a89107da30cbada14f1a647039d0d06.tar.gz
nextcloud-server-041fbdad7a89107da30cbada14f1a647039d0d06.zip
Merge pull request #28185 from nextcloud/investigate/pending_size_for_s3_buckets_master
Fix folder size contained in S3 buckets
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 9f121cc880a..1bdd11e39bd 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -385,13 +385,14 @@ class AmazonS3 extends \OC\Files\Storage\Common {
try {
$stat = [];
if ($this->is_dir($path)) {
- //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) {
+ if ($cacheEntry instanceof CacheEntry) {
$stat['size'] = $cacheEntry->getSize();
$stat['mtime'] = $cacheEntry->getMTime();
+ } else {
+ // Use dummy values
+ $stat['size'] = -1; // Pending
+ $stat['mtime'] = time();
}
} else {
$stat['size'] = $this->getContentLength($path);
@@ -406,6 +407,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
}
+ public function hasUpdated($path, $time) {
+ return $this->getMountOption('filesystem_check_changes', 1) === 1 || parent::hasUpdated($path, $time);
+ }
+
/**
* Return content length for object
*