-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
perf: optimize cache listing for local, ssh and hdfs #2836
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 |
---|---|---|
|
@@ -264,7 +264,9 @@ def open(self, path_info, mode="r", encoding=None): | |
|
||
def list_cache_paths(self): | ||
with self.ssh(self.path_info) as ssh: | ||
return list(ssh.walk_files(self.path_info.path)) | ||
# If we simply return an iterator then with above closes instantly | ||
for path in ssh.walk_files(self.path_info.path): | ||
yield path | ||
Comment on lines
+267
to
+269
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. Wouldn't that mean that connection will be open until the iterator is closed? I am just wondering if it will not become fragile if, in the future, we will start to wrap some logic around this method (for any reason). But also, I am worrying prematurely here. I just wanted to ask this and keep in mind for the future. 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. Yes, this will hold the connection open. Not sure this will be an issue. |
||
|
||
def walk_files(self, path_info): | ||
with self.ssh(path_info) as ssh: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️