Skip to content

Commit bdd1a35

Browse files
committed
Fix folder size contained in S3 buckets
If 'filesystem_check_changes' was set to never, the cached size was alway set to -1 (Pending) on every access Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 39931ca commit bdd1a35

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

apps/files_external/lib/Lib/Storage/AmazonS3.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,14 @@ public function stat($path) {
384384
try {
385385
$stat = [];
386386
if ($this->is_dir($path)) {
387-
//folders don't really exist
388-
$stat['size'] = -1; //unknown
389-
$stat['mtime'] = time();
390387
$cacheEntry = $this->getCache()->get($path);
391-
if ($cacheEntry instanceof CacheEntry && $this->getMountOption('filesystem_check_changes', 1) !== 1) {
388+
if ($cacheEntry instanceof CacheEntry) {
392389
$stat['size'] = $cacheEntry->getSize();
393390
$stat['mtime'] = $cacheEntry->getMTime();
391+
} else {
392+
// Use dummy values
393+
$stat['size'] = -1; // Pending
394+
$stat['mtime'] = time();
394395
}
395396
} else {
396397
$stat['size'] = $this->getContentLength($path);

0 commit comments

Comments
 (0)