mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-19 19:53:32 +08:00
add filer notification
This commit is contained in:
@@ -90,6 +90,9 @@ func (f *Filer) CreateEntry(entry *Entry) error {
|
||||
if mkdirErr != nil {
|
||||
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr)
|
||||
}
|
||||
|
||||
f.NotifyUpdateEvent(nil, dirEntry)
|
||||
|
||||
} else if !dirEntry.IsDirectory() {
|
||||
return fmt.Errorf("%s is a file", dirPath)
|
||||
}
|
||||
@@ -122,6 +125,8 @@ func (f *Filer) CreateEntry(entry *Entry) error {
|
||||
return fmt.Errorf("insert entry %s: %v", entry.FullPath, err)
|
||||
}
|
||||
|
||||
f.NotifyUpdateEvent(oldEntry, entry)
|
||||
|
||||
f.deleteChunksIfNotNew(oldEntry, entry)
|
||||
|
||||
return nil
|
||||
@@ -170,6 +175,9 @@ func (f *Filer) DeleteEntryMetaAndData(p FullPath, isRecursive bool, shouldDelet
|
||||
return nil
|
||||
}
|
||||
glog.V(0).Infof("deleting entry %v", p)
|
||||
|
||||
f.NotifyUpdateEvent(entry, nil)
|
||||
|
||||
return f.store.DeleteEntry(p)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user