diff options
author | Robin Appelman <robin@icewind.nl> | 2022-08-04 12:32:20 +0200 |
---|---|---|
committer | John Molakvoæ (Rebase PR Action) <skjnldsv@users.noreply.github.com> | 2022-10-26 18:45:59 +0000 |
commit | a5036a973c2e5e27354d7112620fdb7a895a44b9 (patch) | |
tree | 71cb802c9acb7f54702ffcf0dc4089e89f22707d /lib/private/Files | |
parent | 43dbd9fa5aa2a18331ed46ae054d6a042f636e2f (diff) | |
download | nextcloud-server-a5036a973c2e5e27354d7112620fdb7a895a44b9.tar.gz nextcloud-server-a5036a973c2e5e27354d7112620fdb7a895a44b9.zip |
allow disabling object store write check
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/ObjectStore/ObjectStoreStorage.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index b7044c2d894..04dd846abe4 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -61,6 +61,9 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { private $logger; + /** @var bool */ + protected $validateWrites = true; + public function __construct($params) { if (isset($params['objectstore']) && $params['objectstore'] instanceof IObjectStore) { $this->objectStore = $params['objectstore']; @@ -75,6 +78,9 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { if (isset($params['objectPrefix'])) { $this->objectPrefix = $params['objectPrefix']; } + if (isset($params['validateWrites'])) { + $this->validateWrites = (bool)$params['validateWrites']; + } //initialize cache with root directory in cache if (!$this->is_dir('/')) { $this->mkdir('/'); @@ -522,7 +528,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { if ($exists) { $this->getCache()->update($fileId, $stat); } else { - if ($this->objectStore->objectExists($urn)) { + if (!$this->validateWrites || $this->objectStore->objectExists($urn)) { $this->getCache()->move($uploadPath, $path); } else { $this->getCache()->remove($uploadPath); |