add filer notification

This commit is contained in:
Chris Lu
2018-08-13 01:20:49 -07:00
parent 75d63db60d
commit f036ef8a3c
13 changed files with 428 additions and 101 deletions

View File

@@ -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)
}