Skip to content

Commit 1c04f22

Browse files
committed
Add comments
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 39931ca commit 1c04f22

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ public function stat($path) {
386386
if ($this->is_dir($path)) {
387387
//folders don't really exist
388388
$stat['size'] = -1; //unknown
389+
// 1. The fact that mtime is always 'now' leads to...
389390
$stat['mtime'] = time();
390391
$cacheEntry = $this->getCache()->get($path);
391392
if ($cacheEntry instanceof CacheEntry && $this->getMountOption('filesystem_check_changes', 1) !== 1) {

lib/private/Files/Cache/Scanner.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ protected function scanChildren($path, $recursive = self::SCAN_RECURSIVE, $reuse
396396
}
397397
}
398398
if ($this->cacheActive) {
399+
// 4. The cached to be updated every time the folder is acceceed.
400+
// But this is always called with -1, because ...
399401
$this->cache->update($folderId, ['size' => $size]);
400402
}
401403
$this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', [$path, $this->storageId]);

lib/private/Files/Storage/Common.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ protected function searchInDir($query, $dir = '') {
328328
* @return bool
329329
*/
330330
public function hasUpdated($path, $time) {
331+
// 2. This being always true, and ...
331332
return $this->filemtime($path) > $time;
332333
}
333334

lib/private/Files/View.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,7 @@ private function getCacheEntry($storage, $internalPath, $relativePath) {
13481348
$scanner = $storage->getScanner($internalPath);
13491349
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
13501350
$data = $cache->get($internalPath);
1351+
// 3. needsUpdate to also be always true, and ...
13511352
} elseif (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) {
13521353
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
13531354
$watcher->update($internalPath, $data);

0 commit comments

Comments
 (0)