diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-05-04 14:57:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 14:57:09 +0200 |
commit | fb296342b9f6081c2e6a1f6784b1666ddd474d7d (patch) | |
tree | 2d65352a94287ed846c2beabd573e39963168a57 /lib | |
parent | 2780bb0b2b12071f03ccb641021eba5931aee5a4 (diff) | |
parent | 734aec152215824107aed0f3c0441f638ea3f0b4 (diff) | |
download | nextcloud-server-fb296342b9f6081c2e6a1f6784b1666ddd474d7d.tar.gz nextcloud-server-fb296342b9f6081c2e6a1f6784b1666ddd474d7d.zip |
Merge pull request #9387 from nextcloud/getcachentry-lock
remove unneeded locks in getCacheEntry
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 c1d2279205c..527ca728229 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); |