diff options
Diffstat (limited to 'weed/operation/lookup.go')
| -rw-r--r-- | weed/operation/lookup.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/operation/lookup.go b/weed/operation/lookup.go index c495af1af..562a11580 100644 --- a/weed/operation/lookup.go +++ b/weed/operation/lookup.go @@ -99,10 +99,13 @@ func LookupVolumeIds(server string, vids []string) (map[string]LookupResult, err //only query unknown_vids err := withMasterServerClient(server, func(masterClient master_pb.SeaweedClient) error { + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second)) + defer cancel() + req := &master_pb.LookupVolumeRequest{ VolumeIds: unknown_vids, } - resp, grpcErr := masterClient.LookupVolume(context.Background(), req) + resp, grpcErr := masterClient.LookupVolume(ctx, req) if grpcErr != nil { return grpcErr } |
