-
Notifications
You must be signed in to change notification settings - Fork 75
fs.find: cache path ids #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, coming back here to double check :) one potential race condition here is if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With base, do you mean the root of the filesystem (aka
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean the local var
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, looks like we need to lock
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it'd have been okay if we used |
||
| contents = [] | ||
| while dir_ids: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.