diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-06-03 16:44:57 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-06-15 14:32:29 +0200 |
commit | 7d72f7d8ce3c15e25382c6121c374de92fe84775 (patch) | |
tree | 9f3fc7f5a73b63183eb62643ec8b7f2cb424b8e3 /lib/private/connector/sabre | |
parent | 5eb0dace8c680425165e36c0b6d64d0245841c3a (diff) | |
download | nextcloud-server-7d72f7d8ce3c15e25382c6121c374de92fe84775.tar.gz nextcloud-server-7d72f7d8ce3c15e25382c6121c374de92fe84775.zip |
keep a read lock while scanning a file or folder
Diffstat (limited to 'lib/private/connector/sabre')
-rw-r--r-- | lib/private/connector/sabre/file.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 5aef30cc577..740660f466b 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -216,15 +216,15 @@ class File extends Node implements IFile { } } - // since we skipped the view we need to scan and emit the hooks ourselves - $partStorage->getScanner()->scanFile($internalPath); - try { $this->fileView->changeLock($this->path, ILockingProvider::LOCK_SHARED); } catch (LockedException $e) { throw new FileLocked($e->getMessage(), $e->getCode(), $e); } + // since we skipped the view we need to scan and emit the hooks ourselves + $partStorage->getScanner()->scanFile($internalPath); + if ($view) { $this->fileView->getUpdater()->propagate($hookPath); if (!$exists) { @@ -249,12 +249,11 @@ class File extends Node implements IFile { } } $this->refreshInfo(); + $this->fileView->unlockFile($this->path, ILockingProvider::LOCK_SHARED); } catch (StorageNotAvailableException $e) { throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage()); } - $this->fileView->unlockFile($this->path, ILockingProvider::LOCK_SHARED); - return '"' . $this->info->getEtag() . '"'; } |