Use 'filesystem_check_enable' as a config option.
This commit is contained in:
parent
3b287f8274
commit
26d169b27c
|
@ -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,
|
||||
|
||||
);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue