Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2021-07-27 11:41:36 +0300
committerLouis Chemineau <louis@chmn.me>2021-07-27 11:41:36 +0300
commitc94810408887543733446dafbcd9955af3d44095 (patch)
treee0ea11f8090b51a2e3a1466d976e84bfed1bc83d
parent7f880164690fe080ff7017356cc5347385f97115 (diff)
Signed-off-by: Louis Chemineau <louis@chmn.me>
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php2
-rw-r--r--lib/private/Files/Cache/Scanner.php2
-rw-r--r--lib/private/Files/Storage/Common.php1
-rw-r--r--lib/private/Files/View.php1
4 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 00ca4a5b8a8..d4d1dc0ba2e 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -380,7 +380,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$stat = [];
if ($this->is_dir($path)) {
//folders don't really exist
+ // 5. The size default to -1 because it is a folder.
$stat['size'] = -1; //unknown
+ // 1. The fact that mtime is always 'now' leads to...
$stat['mtime'] = time();
$cacheEntry = $this->getCache()->get($path);
if ($cacheEntry instanceof CacheEntry && $this->getMountOption('filesystem_check_changes', 1) !== 1) {
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 5481e52bf35..836a6f7d5f3 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -396,6 +396,8 @@ class Scanner extends BasicEmitter implements IScanner {
}
}
if ($this->cacheActive) {
+ // 4. The cached to be updated every time the folder is acceceed.
+ // But this is always called with -1, because ...
$this->cache->update($folderId, ['size' => $size]);
}
$this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', [$path, $this->storageId]);
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 2d03598141f..09ecde72358 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -329,6 +329,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
* @return bool
*/
public function hasUpdated($path, $time) {
+ // 2. This being always true, and ...
return $this->filemtime($path) > $time;
}
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index 0c0bef6600a..0c4b0ac83a1 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1344,6 +1344,7 @@ class View {
$scanner = $storage->getScanner($internalPath);
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
$data = $cache->get($internalPath);
+ // 3. needsUpdate to be also be always true, and ...
} elseif (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) {
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
$watcher->update($internalPath, $data);