Browse Source

clear file.entry

pull/1584/head
Chris Lu 4 years ago
parent
commit
6135cbaa02
  1. 6
      weed/filesys/file.go
  2. 2
      weed/filesys/wfs.go

6
weed/filesys/file.go

@ -301,6 +301,12 @@ func (file *File) setEntry(entry *filer_pb.Entry) {
file.reader = nil
}
func (file *File) clearEntry() {
file.entry = nil
file.entryViewCache = nil
file.reader = nil
}
func (file *File) saveEntry() error {
return file.wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {

2
weed/filesys/wfs.go

@ -96,7 +96,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
fsNode := wfs.fsNodeCache.GetFsNode(filePath)
if fsNode != nil {
if file, ok := fsNode.(*File); ok {
file.setEntry(nil)
file.clearEntry()
}
}
})

Loading…
Cancel
Save