diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-03-02 14:53:29 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-03-02 14:53:29 +0100 |
commit | e61aa3723ede98d7a6bd59474279f8cc28359c48 (patch) | |
tree | 6a1c1ff23f04fcbe6d4d42c7b3e54dd1274d3a04 /lib/private | |
parent | e1f833a6112688845c90ac428d224888537ad423 (diff) | |
parent | 22bc622f9b2488a3c556039096c44d99bc46b1a4 (diff) | |
download | nextcloud-server-e61aa3723ede98d7a6bd59474279f8cc28359c48.tar.gz nextcloud-server-e61aa3723ede98d7a6bd59474279f8cc28359c48.zip |
Merge pull request #14573 from owncloud/enc-migrate-disable-updater
Disable the cache updater when doing the encryption migration
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/cache/updater.php | 19 | ||||
-rw-r--r-- | lib/private/files/view.php | 7 |
2 files changed, 23 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; } /** diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 9cf7eaa2ec1..4f9a4001d69 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -1528,4 +1528,11 @@ class View { $mount ); } + + /** + * @return Updater + */ + public function getUpdater(){ + return $this->updater; + } } |