diff options
Diffstat (limited to 'weed/operation/stats.go')
| -rw-r--r-- | weed/operation/stats.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/weed/operation/stats.go b/weed/operation/stats.go index 364727272..b69a33750 100644 --- a/weed/operation/stats.go +++ b/weed/operation/stats.go @@ -2,18 +2,16 @@ package operation import ( "context" - "time" + "google.golang.org/grpc" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" ) -func Statistics(server string, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error) { +func Statistics(server string, grpcDialOption grpc.DialOption, req *master_pb.StatisticsRequest) (resp *master_pb.StatisticsResponse, err error) { - err = withMasterServerClient(server, func(masterClient master_pb.SeaweedClient) error { - ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second)) - defer cancel() + err = WithMasterServerClient(server, grpcDialOption, func(masterClient master_pb.SeaweedClient) error { - grpcResponse, grpcErr := masterClient.Statistics(ctx, req) + grpcResponse, grpcErr := masterClient.Statistics(context.Background(), req) if grpcErr != nil { return grpcErr } |
