Browse Source

refactoring

pull/1743/head
Chris Lu 4 years ago
parent
commit
62ee484d12
  1. 6
      weed/command/watch.go

6
weed/command/watch.go

@ -76,6 +76,10 @@ func runWatch(cmd *Command, args []string) bool {
return false
}
eachEntryFunc := func(resp *filer_pb.SubscribeMetadataResponse) {
fmt.Printf("dir:%s %+v\n", resp.Directory, resp.EventNotification)
}
watchErr := pb.WithFilerClient(*watchFiler, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
ctx, cancel := context.WithCancel(context.Background())
@ -101,7 +105,7 @@ func runWatch(cmd *Command, args []string) bool {
if !shouldPrint(resp) {
continue
}
fmt.Printf("dir:%s %+v\n", resp.Directory, resp.EventNotification)
eachEntryFunc(resp)
}
})

Loading…
Cancel
Save