You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
709 B

6 years ago
6 years ago
6 years ago
6 years ago
  1. package filer2
  2. import (
  3. "github.com/chrislusf/seaweedfs/weed/glog"
  4. "github.com/chrislusf/seaweedfs/weed/notification"
  5. "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
  6. )
  7. func (f *Filer) NotifyUpdateEvent(oldEntry, newEntry *Entry, deleteChunks bool) {
  8. var key string
  9. if oldEntry != nil {
  10. key = string(oldEntry.FullPath)
  11. } else if newEntry != nil {
  12. key = string(newEntry.FullPath)
  13. } else {
  14. return
  15. }
  16. if notification.Queue != nil {
  17. glog.V(3).Infof("notifying entry update %v", key)
  18. notification.Queue.SendMessage(
  19. key,
  20. &filer_pb.EventNotification{
  21. OldEntry: oldEntry.ToProtoEntry(),
  22. NewEntry: newEntry.ToProtoEntry(),
  23. DeleteChunks: deleteChunks,
  24. },
  25. )
  26. }
  27. }