diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go index 666ab8fe4..1e8a8b540 100644 --- a/weed/filer2/filer.go +++ b/weed/filer2/filer.go @@ -141,7 +141,7 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool) erro } } else { f.maybeAddBucket(dirEntry) - f.NotifyUpdateEvent(nil, dirEntry, false) + f.NotifyUpdateEvent(ctx, nil, dirEntry, false) } } else if !dirEntry.IsDirectory() { @@ -192,7 +192,7 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry, o_excl bool) erro } f.maybeAddBucket(entry) - f.NotifyUpdateEvent(oldEntry, entry, true) + f.NotifyUpdateEvent(ctx, oldEntry, entry, true) f.deleteChunksIfNotNew(oldEntry, entry) diff --git a/weed/filer2/filer_delete_entry.go b/weed/filer2/filer_delete_entry.go index 2fb53c579..7f698a7a1 100644 --- a/weed/filer2/filer_delete_entry.go +++ b/weed/filer2/filer_delete_entry.go @@ -74,7 +74,7 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *Entry if sub.IsDirectory() { dirChunks, err = f.doBatchDeleteFolderMetaAndData(ctx, sub, isRecursive, ignoreRecursiveError, shouldDeleteChunks) f.cacheDelDirectory(string(sub.FullPath)) - f.NotifyUpdateEvent(sub, nil, shouldDeleteChunks) + f.NotifyUpdateEvent(ctx, sub, nil, shouldDeleteChunks) chunks = append(chunks, dirChunks...) } else { chunks = append(chunks, sub.Chunks...) @@ -108,7 +108,7 @@ func (f *Filer) doDeleteEntryMetaAndData(ctx context.Context, entry *Entry, shou if entry.IsDirectory() { f.cacheDelDirectory(string(entry.FullPath)) } - f.NotifyUpdateEvent(entry, nil, shouldDeleteChunks) + f.NotifyUpdateEvent(ctx, entry, nil, shouldDeleteChunks) return nil } diff --git a/weed/filer2/filer_notify.go b/weed/filer2/filer_notify.go index ecb488373..d63e9609c 100644 --- a/weed/filer2/filer_notify.go +++ b/weed/filer2/filer_notify.go @@ -15,7 +15,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/util" ) -func (f *Filer) NotifyUpdateEvent(oldEntry, newEntry *Entry, deleteChunks bool) { +func (f *Filer) NotifyUpdateEvent(ctx context.Context, oldEntry, newEntry *Entry, deleteChunks bool) { var fullpath string if oldEntry != nil { fullpath = string(oldEntry.FullPath) @@ -47,11 +47,11 @@ func (f *Filer) NotifyUpdateEvent(oldEntry, newEntry *Entry, deleteChunks bool) notification.Queue.SendMessage(fullpath, eventNotification) } - f.logMetaEvent(fullpath, eventNotification) + f.logMetaEvent(ctx, fullpath, eventNotification) } -func (f *Filer) logMetaEvent(fullpath string, eventNotification *filer_pb.EventNotification) { +func (f *Filer) logMetaEvent(ctx context.Context, fullpath string, eventNotification *filer_pb.EventNotification) { dir, _ := util.FullPath(fullpath).DirAndName() diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.go index 901f798f0..59be0686d 100644 --- a/weed/server/filer_grpc_server.go +++ b/weed/server/filer_grpc_server.go @@ -220,7 +220,7 @@ func (fs *FilerServer) UpdateEntry(ctx context.Context, req *filer_pb.UpdateEntr glog.V(3).Infof("UpdateEntry %s: %v", filepath.Join(req.Directory, req.Entry.Name), err) } - fs.filer.NotifyUpdateEvent(entry, newEntry, true) + fs.filer.NotifyUpdateEvent(ctx, entry, newEntry, true) return &filer_pb.UpdateEntryResponse{}, err }