Browse Source
more reliable return value for Watcher::checkUpdate
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/29220/head
Robin Appelman
4 years ago
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with
8 additions and
1 deletions
-
lib/private/Files/Cache/Watcher.php
|
|
@ -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; |
|
|
|
} |
|
|
|