remove unneeded locks in getCacheEntry
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
c8cb42fd26
commit
734aec1522
|
@ -1316,15 +1316,13 @@ class View {
|
||||||
try {
|
try {
|
||||||
// if the file is not in the cache or needs to be updated, trigger the scanner and reload the data
|
// 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) {
|
if (!$data || $data['size'] === -1) {
|
||||||
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
|
||||||
if (!$storage->file_exists($internalPath)) {
|
if (!$storage->file_exists($internalPath)) {
|
||||||
$this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// don't need to get a lock here since the scanner does it's own locking
|
||||||
$scanner = $storage->getScanner($internalPath);
|
$scanner = $storage->getScanner($internalPath);
|
||||||
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
|
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
|
||||||
$data = $cache->get($internalPath);
|
$data = $cache->get($internalPath);
|
||||||
$this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
|
||||||
} else if (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) {
|
} else if (!Cache\Scanner::isPartialFile($internalPath) && $watcher->needsUpdate($internalPath, $data)) {
|
||||||
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
||||||
$watcher->update($internalPath, $data);
|
$watcher->update($internalPath, $data);
|
||||||
|
|
Loading…
Reference in New Issue