mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
bugfix:delete Directory cache when filer2 delete Directory
This commit is contained in:
parent
2fd48df9d9
commit
c523bc4f07
|
@ -137,6 +137,7 @@ func (f *Filer) DeleteEntryMetaAndData(p FullPath, shouldDeleteChunks bool) (err
|
|||
if len(entries) > 0 {
|
||||
return fmt.Errorf("folder %s is not empty", p)
|
||||
}
|
||||
f.cacheDelDirectory(string(p))
|
||||
}
|
||||
|
||||
if shouldDeleteChunks {
|
||||
|
@ -153,6 +154,14 @@ func (f *Filer) ListDirectoryEntries(p FullPath, startFileName string, inclusive
|
|||
return f.store.ListDirectoryEntries(p, startFileName, inclusive, limit)
|
||||
}
|
||||
|
||||
func (f *Filer) cacheDelDirectory(dirpath string) {
|
||||
if f.directoryCache == nil {
|
||||
return
|
||||
}
|
||||
f.directoryCache.Delete(dirpath)
|
||||
return
|
||||
}
|
||||
|
||||
func (f *Filer) cacheGetDirectory(dirpath string) *Entry {
|
||||
if f.directoryCache == nil {
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue