mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 03:19:47 +08:00
don't cache entire mfs tree on add finalize
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
@ -231,6 +231,8 @@ func (adder *Adder) outputDirs(path string, fsn mfs.FSNode) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fsn.Uncache(name)
|
||||
}
|
||||
nd, err := fsn.GetNode()
|
||||
if err != nil {
|
||||
|
@ -152,6 +152,13 @@ func (d *Directory) Child(name string) (FSNode, error) {
|
||||
return d.childUnsync(name)
|
||||
}
|
||||
|
||||
func (d *Directory) Uncache(name string) {
|
||||
d.lock.Lock()
|
||||
defer d.lock.Unlock()
|
||||
delete(d.files, name)
|
||||
delete(d.childDirs, name)
|
||||
}
|
||||
|
||||
// childFromDag searches through this directories dag node for a child link
|
||||
// with the given name
|
||||
func (d *Directory) childFromDag(name string) (*dag.Node, error) {
|
||||
|
Reference in New Issue
Block a user