From 26d169b27c43d06db1158990e33939b85d14a60d Mon Sep 17 00:00:00 2001 From: ringmaster <epithet@gmail.com> Date: Tue, 27 May 2014 16:01:16 -0400 Subject: [PATCH] Use 'filesystem_check_enable' as a config option. --- config/config.sample.php | 5 ++++- lib/private/files/cache/scanner.php | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php index 80694837ed..8fb782e7cf 100755 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -291,6 +291,9 @@ $CONFIG = array( * 1 -> check each file or folder at most once per request, recomended for general use if outside changes might happen * 2 -> check every time the filesystem is used, causes a performance hit when using external storages, not recomended for regular use */ -'filesystem_check_changes' => 1 +'filesystem_check_changes' => 1, + +/* specifies whether changes in the filesystem outside of owncloud affect cached data about those files */ +'filesystem_check_enable' => 1, ); diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index 24d406f7cd..e838a8b625 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -157,7 +157,7 @@ class Scanner extends BasicEmitter { } } if (!empty($newData)) { - $addToCache = Config::getSystemValue('allow_scanner_to_affect_cache', true); + $addToCache = Config::getSystemValue('filesystem_check_enable', true); \OC_Hook::emit('Scanner', 'addToCache', array('file' => $file, 'addToCache' => &$addToCache, 'data' => &$newData)); if($addToCache) { $data['fileid'] = $this->cache->put($file, $newData); @@ -166,7 +166,7 @@ class Scanner extends BasicEmitter { \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId)); } } else { - $removeFromCache = Config::getSystemValue('allow_scanner_to_affect_cache', true); + $removeFromCache = Config::getSystemValue('filesystem_check_enable', true); \OC_Hook::emit('Scanner', 'removeFromCache', array('file' => $file, 'removeFromCache' => &$removeFromCache)); if($removeFromCache) { $this->cache->remove($file); @@ -253,7 +253,7 @@ class Scanner extends BasicEmitter { $removedChildren = \array_diff($existingChildren, $newChildren); foreach ($removedChildren as $childName) { $child = ($path) ? $path . '/' . $childName : $childName; - $removeFromCache = Config::getSystemValue('allow_scanner_to_affect_cache', true); + $removeFromCache = Config::getSystemValue('filesystem_check_enable', true); \OC_Hook::emit('Scanner', 'removeFromCache', array('file' => $child, 'removeFromCache' => &$removeFromCache)); if($removeFromCache) { $this->cache->remove($child); @@ -277,7 +277,7 @@ class Scanner extends BasicEmitter { } } $newData = array('size' => $size); - $addToCache = Config::getSystemValue('allow_scanner_to_affect_cache', true); + $addToCache = Config::getSystemValue('filesystem_check_enable', true); \OC_Hook::emit('Scanner', 'addToCache', array('file' => $child, 'addToCache' => &$addToCache, 'data' => &$newData)); if($addToCache) { $this->cache->put($path, $newData); -- GitLab