when a file is locked use old cache data
This commit is contained in:
parent
0a56313ca4
commit
c487f0f138
|
@ -1194,6 +1194,7 @@ class View {
|
||||||
$data = $cache->get($internalPath);
|
$data = $cache->get($internalPath);
|
||||||
$watcher = $storage->getWatcher($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 the file is not in the cache or needs to be updated, trigger the scanner and reload the data
|
||||||
if (!$data) {
|
if (!$data) {
|
||||||
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
$this->lockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
||||||
|
@ -1212,6 +1213,9 @@ class View {
|
||||||
$data = $cache->get($internalPath);
|
$data = $cache->get($internalPath);
|
||||||
$this->unlockFile($relativePath, ILockingProvider::LOCK_SHARED);
|
$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'])) {
|
if ($data and isset($data['fileid'])) {
|
||||||
// upgrades from oc6 or lower might not have the permissions set in the file cache
|
// 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);
|
$data = $cache->get($internalPath);
|
||||||
$watcher = $storage->getWatcher($internalPath);
|
$watcher = $storage->getWatcher($internalPath);
|
||||||
|
try {
|
||||||
if (!$data or $data['size'] === -1) {
|
if (!$data or $data['size'] === -1) {
|
||||||
$this->lockFile($directory, ILockingProvider::LOCK_SHARED);
|
$this->lockFile($directory, ILockingProvider::LOCK_SHARED);
|
||||||
if (!$storage->file_exists($internalPath)) {
|
if (!$storage->file_exists($internalPath)) {
|
||||||
|
@ -1295,6 +1300,9 @@ class View {
|
||||||
$data = $cache->get($internalPath);
|
$data = $cache->get($internalPath);
|
||||||
$this->unlockFile($directory, ILockingProvider::LOCK_SHARED);
|
$this->unlockFile($directory, ILockingProvider::LOCK_SHARED);
|
||||||
}
|
}
|
||||||
|
} catch (LockedException $e) {
|
||||||
|
// if the file is locked we just use the old cache info
|
||||||
|
}
|
||||||
|
|
||||||
$folderId = $data['fileid'];
|
$folderId = $data['fileid'];
|
||||||
$contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter
|
$contents = $cache->getFolderContentsById($folderId); //TODO: mimetype_filter
|
||||||
|
|
Loading…
Reference in New Issue