Skip to content

Commit

Permalink
fs.find: cache path id
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Jun 22, 2023
1 parent 0a50287 commit 4897344
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pydrive2/fs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,7 @@ def find(self, path, detail=False, **kwargs):
cached = base in self._ids_cache["dirs"]
if not cached:
dir_ids = self._path_to_item_ids(base)
if dir_ids:
dir_id = min(dir_ids)
self._cache_path_id(base, dir_id)
for item in self._gdrive_list_ids([dir_id]):
item_path = posixpath.join(base, item["title"])
self._cache_path_id(item_path, item["id"])
self._cache_path_id(base, *dir_ids)

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

0 comments on commit 4897344

Please sign in to comment.