Browse Source

more reliable return value for Watcher::checkUpdate

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/29220/head
Robin Appelman 4 years ago
parent
commit
55346b5d6c
No known key found for this signature in database GPG Key ID: 42B69D8A64526EFB
  1. 9
      lib/private/Files/Cache/Watcher.php

9
lib/private/Files/Cache/Watcher.php

@ -88,7 +88,14 @@ class Watcher implements IWatcher {
}
if ($cachedEntry === false || $this->needsUpdate($path, $cachedEntry)) {
$this->update($path, $cachedEntry);
return true;
if ($cachedEntry === false) {
return true;
} else {
// storage backends can sometimes return false positives, only return true if the scanner actually found a change
$newEntry = $this->cache->get($path);
return $newEntry->getStorageMTime() > $cachedEntry->getStorageMTime();
}
} else {
return false;
}

Loading…
Cancel
Save