caching of userfolder

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2022-03-24 15:41:34 +01:00
parent 70c37c2717
commit f7c942a943
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -383,16 +383,14 @@ class Root extends Folder implements IRootFolder {
if ($this->mountManager->getSetupManager()->isSetupComplete($userObject)) {
try {
$folder = $this->get('/' . $userId . '/files');
if ($folder instanceof \OCP\Files\Folder) {
return $folder;
} else {
if (!$folder instanceof \OCP\Files\Folder) {
throw new \Exception("User folder for $userId exists as a file");
}
} catch (NotFoundException $e) {
if (!$this->nodeExists('/' . $userId)) {
$this->newFolder('/' . $userId);
}
return $this->newFolder('/' . $userId . '/files');
$folder = $this->newFolder('/' . $userId . '/files');
}
} else {
$folder = new LazyUserFolder($this, $userObject);