mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-18 23:38:18 +00:00
directories: make initialization of the download cache lazy
If you open up a directory containing thousands of files, it currently computes the cache filename and checks for the cache file on disk immediately for each immutble file in that directory. With this patch, it delays those steps until you try to do something with an immutable file that could use the cache.
This commit is contained in:
@ -428,9 +428,7 @@ class Client(node.Node, pollmixin.PollMixin):
|
||||
if isinstance(u, LiteralFileURI):
|
||||
node = LiteralFileNode(u, self) # LIT
|
||||
else:
|
||||
key = base32.b2a(u.storage_index)
|
||||
cachefile = self.download_cache_dirman.get_file(key)
|
||||
node = FileNode(u, self, cachefile) # CHK
|
||||
node = FileNode(u, self, self.download_cache_dirman) # CHK
|
||||
else:
|
||||
assert IMutableFileURI.providedBy(u), u
|
||||
node = MutableFileNode(self).init_from_uri(u)
|
||||
|
Reference in New Issue
Block a user