diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-02-20 01:01:01 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-02-20 01:01:01 -0800 |
| commit | e10868899067ad72f822e0d9571b33fa9d1fc7f6 (patch) | |
| tree | 6376da9bf7df15459fc429a18cce989151e5a316 /weed/operation/sync_volume.go | |
| parent | 097b7a321eae4a70d375ca6d3dea1b118fe77795 (diff) | |
| download | seaweedfs-e10868899067ad72f822e0d9571b33fa9d1fc7f6.tar.xz seaweedfs-e10868899067ad72f822e0d9571b33fa9d1fc7f6.zip | |
avoid grpc 5 seconds timeout
some operations may take longer than 5 seconds.
only keep the timeout for raft operations
Diffstat (limited to 'weed/operation/sync_volume.go')
| -rw-r--r-- | weed/operation/sync_volume.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/weed/operation/sync_volume.go b/weed/operation/sync_volume.go index bf81415c9..c979254f4 100644 --- a/weed/operation/sync_volume.go +++ b/weed/operation/sync_volume.go @@ -3,22 +3,18 @@ package operation import ( "context" "fmt" - "google.golang.org/grpc" - "io" - "time" - "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb" . "github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/util" + "google.golang.org/grpc" + "io" ) func GetVolumeSyncStatus(server string, grpcDialOption grpc.DialOption, vid uint32) (resp *volume_server_pb.VolumeSyncStatusResponse, err error) { WithVolumeServerClient(server, grpcDialOption, func(client volume_server_pb.VolumeServerClient) error { - ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second)) - defer cancel() - resp, err = client.VolumeSyncStatus(ctx, &volume_server_pb.VolumeSyncStatusRequest{ + resp, err = client.VolumeSyncStatus(context.Background(), &volume_server_pb.VolumeSyncStatusRequest{ VolumdId: vid, }) return nil |
