mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-18 06:30:07 +08:00
refactoring
This commit is contained in:
parent
1efb51ba84
commit
62ee484d12
@ -76,6 +76,10 @@ func runWatch(cmd *Command, args []string) bool {
|
|||||||
return false
|
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 {
|
watchErr := pb.WithFilerClient(*watchFiler, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
@ -101,7 +105,7 @@ func runWatch(cmd *Command, args []string) bool {
|
|||||||
if !shouldPrint(resp) {
|
if !shouldPrint(resp) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf("dir:%s %+v\n", resp.Directory, resp.EventNotification)
|
eachEntryFunc(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user