summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-25 14:48:20 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-25 14:48:20 +0200
commit53484244176ee9c026affa67e4568e7d93dd4a36 (patch)
tree75a93ee1f7e1dc203858f851c3253beda7a8d7da /lib
parent972ce1fe6e4bf746a1593fbcdc2a1728d1153261 (diff)
parent4ac16001e024c869420a5d9775f3b5bb162311c4 (diff)
downloadnextcloud-server-53484244176ee9c026affa67e4568e7d93dd4a36.tar.gz
nextcloud-server-53484244176ee9c026affa67e4568e7d93dd4a36.zip
Merge pull request #24205 from owncloud/scanner-locking
add locks in the scanner to prevent multiple scanners running on the …
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Scanner.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 8730707f1c2..feefe29d276 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -296,6 +296,7 @@ class Scanner extends BasicEmitter implements IScanner {
}
if ($lock) {
if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
+ $this->storage->acquireLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider);
$this->storage->acquireLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
}
}
@@ -307,6 +308,7 @@ class Scanner extends BasicEmitter implements IScanner {
if ($lock) {
if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
$this->storage->releaseLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
+ $this->storage->releaseLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider);
}
}
return $data;