mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactoring
This commit is contained in:
parent
62ee484d12
commit
6e12a3a490
|
@ -76,8 +76,9 @@ func runWatch(cmd *Command, args []string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
eachEntryFunc := func(resp *filer_pb.SubscribeMetadataResponse) {
|
||||
eachEntryFunc := func(resp *filer_pb.SubscribeMetadataResponse) error {
|
||||
fmt.Printf("dir:%s %+v\n", resp.Directory, resp.EventNotification)
|
||||
return nil
|
||||
}
|
||||
|
||||
watchErr := pb.WithFilerClient(*watchFiler, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
@ -105,7 +106,9 @@ func runWatch(cmd *Command, args []string) bool {
|
|||
if !shouldPrint(resp) {
|
||||
continue
|
||||
}
|
||||
eachEntryFunc(resp)
|
||||
if err = eachEntryFunc(resp); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue