summaryrefslogtreecommitdiffstats
path: root/lib/private/connector
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-06-17 11:52:54 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-06-17 11:52:54 +0200
commitd2305f25278808d781fc8c44363e83adc7b71b9a (patch)
treee98114876b2758dc0839a13423b10bef3f12daf3 /lib/private/connector
parent3898b8c9b89609a199b87d4d3ce1c7fe95026c1c (diff)
parentf02e110aea10d2bfc1921d164c1bb6283ea6daaf (diff)
downloadnextcloud-server-d2305f25278808d781fc8c44363e83adc7b71b9a.tar.gz
nextcloud-server-d2305f25278808d781fc8c44363e83adc7b71b9a.zip
Merge pull request #16729 from owncloud/scanner-read-lock
keep a read lock while scanning a file or folder
Diffstat (limited to 'lib/private/connector')
-rw-r--r--lib/private/connector/sabre/file.php9
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() . '"';
}