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 committed Oct 26, 2021
commit 99ba96524e2e0caf7316375bb215a85af9480c2d
9 changes: 8 additions & 1 deletion lib/private/Files/Cache/Watcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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