diff options
author | Robin Appelman <robin@icewind.nl> | 2018-05-04 12:51:41 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-05-04 12:51:41 +0200 |
commit | 734aec152215824107aed0f3c0441f638ea3f0b4 (patch) | |
tree | c1570e63a400c0d0b8aeece3d79715489c3b4290 /lib | |
parent | c8cb42fd2671c8b6ed3257e62fa9f6a24474acb8 (diff) | |
download | nextcloud-server-734aec152215824107aed0f3c0441f638ea3f0b4.tar.gz nextcloud-server-734aec152215824107aed0f3c0441f638ea3f0b4.zip |
remove unneeded locks in getCacheEntry
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/View.php | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index a149cdf0af5..e026b150aca 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1316,15 +1316,13 @@ class View { try { // if the file is not in the cache or needs to be updated, trigger the scanner and reload the data if (!$data || $data['size'] === -1) { - $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED); if (!$storage->file_exists($internalPath)) { - $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED); return false; } + // don't need to get a lock here since the scanner does it's own locking $scanner = $storage->getScanner($internalPath); $scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW); $data = $cache->get($internalPath); - $this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED); } else if (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) { $this->lockFile($relativePath, ILockingProvider::LOCK_SHARED); $watcher->update($internalPath, $data); |