From 724c29164718a2b1065ed01bdb8ab737a6683c66 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 30 Jan 2026 17:01:38 +0100 Subject: [PATCH] perf: Avoid calling getById on root Signed-off-by: Carl Schwan --- lib/Service/FsEventService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Service/FsEventService.php b/lib/Service/FsEventService.php index d675b22..5e87e64 100644 --- a/lib/Service/FsEventService.php +++ b/lib/Service/FsEventService.php @@ -1,5 +1,7 @@ allowedPath($node)) { + $user = $node->getOwner(); + if (!$this->allowedPath($node) || $user === null) { return; } + $userFolder = $this->rootFolder->getUserFolder($user->getUID()); if ($node instanceof Folder) { if (!$recurse) { return; @@ -117,7 +121,7 @@ public function onInsert(Node $node, bool $recurse = true, bool $update = false) } foreach ($fileIds as $fileId) { - $file = current($this->rootFolder->getById($fileId)); + $file = current($userFolder->getById($fileId)); if (!$file instanceof File) { continue; }