aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache/watcher.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-10-02 17:37:33 +0200
committerRobin Appelman <icewind@owncloud.com>2014-10-24 12:32:55 +0200
commit0a3f57f832213d5b4f6678581d7c2bc8d6832542 (patch)
tree6b7d03a6d56441d0dce5c7765f247b0a6b406907 /lib/private/files/cache/watcher.php
parent0525341a1243bcf1ef992407af524e391efd7624 (diff)
downloadnextcloud-server-0a3f57f832213d5b4f6678581d7c2bc8d6832542.tar.gz
nextcloud-server-0a3f57f832213d5b4f6678581d7c2bc8d6832542.zip
Pass the cached data to the filesystem watcher
Diffstat (limited to 'lib/private/files/cache/watcher.php')
-rw-r--r--lib/private/files/cache/watcher.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/files/cache/watcher.php b/lib/private/files/cache/watcher.php
index 5a4f53fb73d..f4572895b09 100644
--- a/lib/private/files/cache/watcher.php
+++ b/lib/private/files/cache/watcher.php
@@ -55,11 +55,14 @@ class Watcher {
* check $path for updates
*
* @param string $path
- * @return boolean|array true if path was updated, otherwise the cached data is returned
+ * @param array $cachedEntry
+ * @return boolean true if path was updated
*/
- public function checkUpdate($path) {
+ public function checkUpdate($path, $cachedEntry = null) {
if ($this->watchPolicy === self::CHECK_ALWAYS or ($this->watchPolicy === self::CHECK_ONCE and array_search($path, $this->checkedPaths) === false)) {
- $cachedEntry = $this->cache->get($path);
+ if (is_null($cachedEntry)) {
+ $cachedEntry = $this->cache->get($path);
+ }
$this->checkedPaths[] = $path;
if ($this->storage->hasUpdated($path, $cachedEntry['storage_mtime'])) {
if ($this->storage->is_dir($path)) {
@@ -73,7 +76,7 @@ class Watcher {
$this->cache->correctFolderSize($path);
return true;
}
- return $cachedEntry;
+ return false;
} else {
return false;
}