more reliable return value for Watcher::checkUpdate

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2021-10-15 16:03:18 +02:00
parent 4bd08af2ad
commit 55346b5d6c
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -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;
}