diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2019-01-10 09:02:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-10 09:02:13 -0800 |
| commit | e978f3aaaba844f9b8def8fa9aed7872595f3245 (patch) | |
| tree | 3d000a41408651ef4d2b6331501c550387c4a5a7 /weed/operation/sync_volume.go | |
| parent | 2a75a36b275ea7f47a95ad2efc70be22d5ed3fe2 (diff) | |
| parent | 39c745588111cebef0475f2453ee0715e0153c49 (diff) | |
| download | seaweedfs-e978f3aaaba844f9b8def8fa9aed7872595f3245.tar.xz seaweedfs-e978f3aaaba844f9b8def8fa9aed7872595f3245.zip | |
Merge pull request #829 from PapaYofen/fix-823
Fix https://github.com/chrislusf/seaweedfs/issues/823
Diffstat (limited to 'weed/operation/sync_volume.go')
| -rw-r--r-- | weed/operation/sync_volume.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/operation/sync_volume.go b/weed/operation/sync_volume.go index ac2e2bf79..e40c7de41 100644 --- a/weed/operation/sync_volume.go +++ b/weed/operation/sync_volume.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "time" "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb" . "github.com/chrislusf/seaweedfs/weed/storage/types" @@ -13,7 +14,10 @@ import ( func GetVolumeSyncStatus(server string, vid uint32) (resp *volume_server_pb.VolumeSyncStatusResponse, err error) { WithVolumeServerClient(server, func(client volume_server_pb.VolumeServerClient) error { - resp, err = client.VolumeSyncStatus(context.Background(), &volume_server_pb.VolumeSyncStatusRequest{ + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5*time.Second)) + defer cancel() + + resp, err = client.VolumeSyncStatus(ctx, &volume_server_pb.VolumeSyncStatusRequest{ VolumdId: vid, }) return nil |
