From b9fc857613ee18cd08e32c691933a82f5f371e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Thu, 22 Jun 2023 08:38:12 +0545 Subject: [PATCH] find: cache path item ids --- pydrive2/fs/spec.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pydrive2/fs/spec.py b/pydrive2/fs/spec.py index 997b0a5e..c5abe03d 100644 --- a/pydrive2/fs/spec.py +++ b/pydrive2/fs/spec.py @@ -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: