]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add a config option fro setting the filesystem watcher policy
authorRobin Appelman <icewind@owncloud.com>
Thu, 22 May 2014 11:45:55 +0000 (13:45 +0200)
committerRobin Appelman <icewind@owncloud.com>
Fri, 23 May 2014 10:20:31 +0000 (12:20 +0200)
config/config.sample.php
lib/private/files/storage/common.php

index 708e8367023011dfef041e976424e5822bfdf58a..80694837edc71091f10ac0bf82bbd5c62e191049 100755 (executable)
@@ -283,5 +283,14 @@ $CONFIG = array(
  * cache directory and "$user" is the user.
  *
  */
-'cache_path' => ''
+'cache_path' => '',
+
+/*
+ * specifies how often the filesystem is checked for changes made outside owncloud
+ * 0 -> never check the filesystem for outside changes, provides a performance increase when it's certain that no changes are made directly to the filesystem
+ * 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
+
 );
index fef33cabd879f3a261a1c0926d46f591c074a3eb..45db51c1659b7bc78fc537d47b003b6201019dd3 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 namespace OC\Files\Storage;
+use OC\Files\Cache\Watcher;
 
 /**
  * Storage backend class for providing common filesystem operation methods
@@ -276,6 +277,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
        public function getWatcher($path = '') {
                if (!isset($this->watcher)) {
                        $this->watcher = new \OC\Files\Cache\Watcher($this);
+                       $this->watcher->setPolicy(\OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_ONCE));
                }
                return $this->watcher;
        }