Skip to content
Prev Previous commit
Next Next commit
more reliable return value for Watcher::checkUpdate
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Oct 22, 2021
commit 5f438375a98fc202a6ebe2b3e7eab940a0304140
9 changes: 8 additions & 1 deletion lib/private/Files/Cache/Watcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ public function checkUpdate($path, $cachedEntry = null) {
}
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;
}
Expand Down