aboutsummaryrefslogtreecommitdiff
path: root/weed/command/watch.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-09 11:21:23 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-09 11:21:23 -0700
commit387ab6796f274151f802ccdab8756b959b5fb1cb (patch)
treea3b95f5bdba66f12c609b5e53b262b011a47a450 /weed/command/watch.go
parent4fc0bd1a8173e284ff919edb5214f5adf7a90f06 (diff)
downloadseaweedfs-387ab6796f274151f802ccdab8756b959b5fb1cb.tar.xz
seaweedfs-387ab6796f274151f802ccdab8756b959b5fb1cb.zip
filer: cross cluster synchronization
Diffstat (limited to 'weed/command/watch.go')
-rw-r--r--weed/command/watch.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/watch.go b/weed/command/watch.go
index 9340db141..3bee0eabe 100644
--- a/weed/command/watch.go
+++ b/weed/command/watch.go
@@ -78,7 +78,10 @@ func runWatch(cmd *Command, args []string) bool {
watchErr := pb.WithFilerClient(*watchFiler, grpcDialOption, func(client filer_pb.SeaweedFilerClient) error {
- stream, err := client.SubscribeMetadata(context.Background(), &filer_pb.SubscribeMetadataRequest{
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+
+ stream, err := client.SubscribeMetadata(ctx, &filer_pb.SubscribeMetadataRequest{
ClientName: "watch",
PathPrefix: *watchTarget,
SinceNs: time.Now().Add(-*watchStart).UnixNano(),