File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -386,11 +386,15 @@ public function getFirstNodeByIdInPath(int $id, string $path): ?INode {
386386 $ cachedPath = $ this ->pathByIdCache ->get ($ this ->user ->getUID () . ':: ' . $ id );
387387 if ($ cachedPath && str_starts_with ($ cachedPath , $ path )) {
388388 // getting the node by path is significantly cheaper than finding it by id
389- $ node = $ this ->get ($ cachedPath );
390- // by validating that the cached path still has the requested fileid we can work around the need to invalidate the cached path
391- // if the cached path is invalid or a different file now we fall back to the uncached logic
392- if ($ node && $ node ->getId () === $ id ) {
393- return $ node ;
389+ try {
390+ $ node = $ this ->get ($ cachedPath );
391+ // by validating that the cached path still has the requested fileid we can work around the need to invalidate the cached path
392+ // if the cached path is invalid or a different file now we fall back to the uncached logic
393+ if ($ node && $ node ->getId () === $ id ) {
394+ return $ node ;
395+ }
396+ } catch (NotFoundException |NotPermittedException ) {
397+ // The file may be moved but the old path still in cache
394398 }
395399 }
396400 }
You can’t perform that action at this time.
0 commit comments