Skip to content
Snippets Groups Projects
Commit c487f0f1 authored by Robin Appelman's avatar Robin Appelman
Browse files

when a file is locked use old cache data

parent 0a56313c
No related branches found
No related tags found
No related merge requests found
......@@ -1194,6 +1194,7 @@ class View {
$data = $cache->get($internalPath);
$watcher = $storage->getWatcher($internalPath);
try {
// if the file is not in the cache or needs to be updated, trigger the scanner and reload the data
if (!$data) {
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
......@@ -1212,6 +1213,9 @@ class View {
$data = $cache->get($internalPath);
$this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
}
} catch (LockedException $e) {
// if the file is locked we just use the old cache info
}
if ($data and isset($data['fileid'])) {
// upgrades from oc6 or lower might not have the permissions set in the file cache
......@@ -1278,6 +1282,7 @@ class View {
$data = $cache->get($internalPath);
$watcher = $storage->getWatcher($internalPath);
try {
if (!$data or $data['size'] === -1) {
$this->lockFile($directory, ILockingProvider::LOCK_SHARED);
if (!$storage->file_exists($internalPath)) {
......@@ -1295,6 +1300,9 @@ class View {
$data = $cache->get($internalPath);
$this->unlockFile($directory, ILockingProvider::LOCK_SHARED);
}
} catch (LockedException $e) {
// if the file is locked we just use the old cache info
}
$folderId = $data['fileid'];
$contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment