From 99ba96524e2e0caf7316375bb215a85af9480c2d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 15 Oct 2021 16:03:18 +0200 Subject: more reliable return value for Watcher::checkUpdate Signed-off-by: Robin Appelman --- lib/private/Files/Cache/Watcher.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/private/Files') diff --git a/lib/private/Files/Cache/Watcher.php b/lib/private/Files/Cache/Watcher.php index 19e17e60959..15e15f9f458 100644 --- a/lib/private/Files/Cache/Watcher.php +++ b/lib/private/Files/Cache/Watcher.php @@ -89,7 +89,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; } -- cgit v1.2.3