summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-02-14 22:08:13 +0100
committerRobin Appelman <robin@icewind.nl>2020-04-01 14:14:52 +0200
commit3fb32f6f3d0bf3a665229c9f1bcf6ea6605860a4 (patch)
tree7073d32d976273305575af378570655a12c68a89 /lib/private/Files/Cache
parent5439469b687478eb5626f69adce3e38060fcd99e (diff)
downloadnextcloud-server-3fb32f6f3d0bf3a665229c9f1bcf6ea6605860a4.tar.gz
nextcloud-server-3fb32f6f3d0bf3a665229c9f1bcf6ea6605860a4.zip
reuse known parentId when inserting cache entries in scanner
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r--lib/private/Files/Cache/Cache.php4
-rw-r--r--lib/private/Files/Cache/Scanner.php1
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index 92e81cd0f07..e57124d6cbd 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -274,7 +274,9 @@ class Cache implements ICache {
}
$data['path'] = $file;
- $data['parent'] = $this->getParentId($file);
+ if (!isset($data['parent'])) {
+ $data['parent'] = $this->getParentId($file);
+ }
$data['name'] = basename($file);
[$values, $extensionValues] = $this->normalizeData($data);
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 564428bb6a4..039041c1dce 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -220,6 +220,7 @@ class Scanner extends BasicEmitter implements IScanner {
if (!empty($newData)) {
// Reset the checksum if the data has changed
$newData['checksum'] = '';
+ $newData['parent'] = $parentId;
$data['fileid'] = $this->addToCache($file, $newData, $fileId);
}
if (isset($cacheData['size'])) {