Skip to content

Commit

Permalink
find: cache path item ids (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Jun 22, 2023
1 parent 37551b3 commit 53ee84c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pydrive2/fs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ def find(self, path, detail=False, **kwargs):
bucket, base = self.split_path(path)

seen_paths = set()
cached = base in self._ids_cache["dirs"]
if not cached:
dir_ids = self._path_to_item_ids(base)
self._cache_path_id(base, *dir_ids)

dir_ids = [self._ids_cache["ids"].copy()]
contents = []
while dir_ids:
Expand Down

0 comments on commit 53ee84c

Please sign in to comment.