mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 06:37:56 -04:00
more reliable return value for Watcher::checkUpdate
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
4bd08af2ad
commit
55346b5d6c
1 changed files with 8 additions and 1 deletions
|
|
@ -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…
Reference in a new issue