diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-02-27 14:14:42 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-02-27 17:14:16 +0100 |
commit | f6182aa87e628f3cf2483f042899d0c2e0673fcb (patch) | |
tree | 6b6ba6520c9686a334797e2d617e1b133eac12fe /lib/private/files/cache/updater.php | |
parent | b4dfd043d7eef8767cf6727cb0651851b8139da7 (diff) | |
download | nextcloud-server-f6182aa87e628f3cf2483f042899d0c2e0673fcb.tar.gz nextcloud-server-f6182aa87e628f3cf2483f042899d0c2e0673fcb.zip |
Allow disabling the cache updater
Diffstat (limited to 'lib/private/files/cache/updater.php')
-rw-r--r-- | lib/private/files/cache/updater.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index eeb763921bb..248748ea4a9 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -13,6 +13,11 @@ namespace OC\Files\Cache; */ class Updater { /** + * @var bool + */ + protected $enabled = true; + + /** * @var \OC\Files\View */ protected $view; @@ -30,6 +35,14 @@ class Updater { $this->propagator = new ChangePropagator($view); } + public function disable() { + $this->enabled = false; + } + + public function enable() { + $this->enabled = true; + } + public function propagate($path, $time = null) { if (Scanner::isPartialFile($path)) { return; @@ -45,7 +58,7 @@ class Updater { * @param int $time */ public function update($path, $time = null) { - if (Scanner::isPartialFile($path)) { + if (!$this->enabled or Scanner::isPartialFile($path)) { return; } /** @@ -70,7 +83,7 @@ class Updater { * @param string $path */ public function remove($path) { - if (Scanner::isPartialFile($path)) { + if (!$this->enabled or Scanner::isPartialFile($path)) { return; } /** @@ -97,7 +110,7 @@ class Updater { * @param string $target */ public function rename($source, $target) { - if (Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) { + if (!$this->enabled or Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) { return; } /** |