diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-02-25 22:23:59 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-02-25 22:23:59 -0800 |
| commit | 97ab8a1976f3ba056af8d5b630dcb43006425b51 (patch) | |
| tree | f98588240db017bf7d372b0f216355892cf868e8 /weed/server/volume_grpc_client_to_master.go | |
| parent | ca4ca1ae6f87c6fcbf9c486722f36b4f07166187 (diff) | |
| download | seaweedfs-97ab8a1976f3ba056af8d5b630dcb43006425b51.tar.xz seaweedfs-97ab8a1976f3ba056af8d5b630dcb43006425b51.zip | |
remove ctx if possible
Diffstat (limited to 'weed/server/volume_grpc_client_to_master.go')
| -rw-r--r-- | weed/server/volume_grpc_client_to_master.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/server/volume_grpc_client_to_master.go b/weed/server/volume_grpc_client_to_master.go index dc47c2884..2168afee7 100644 --- a/weed/server/volume_grpc_client_to_master.go +++ b/weed/server/volume_grpc_client_to_master.go @@ -42,7 +42,7 @@ func (vs *VolumeServer) heartbeat() { continue } vs.store.MasterAddress = master - newLeader, err = vs.doHeartbeat(context.Background(), master, masterGrpcAddress, grpcDialOption, time.Duration(vs.pulseSeconds)*time.Second) + newLeader, err = vs.doHeartbeat(master, masterGrpcAddress, grpcDialOption, time.Duration(vs.pulseSeconds)*time.Second) if err != nil { glog.V(0).Infof("heartbeat error: %v", err) time.Sleep(time.Duration(vs.pulseSeconds) * time.Second) @@ -53,16 +53,16 @@ func (vs *VolumeServer) heartbeat() { } } -func (vs *VolumeServer) doHeartbeat(ctx context.Context, masterNode, masterGrpcAddress string, grpcDialOption grpc.DialOption, sleepInterval time.Duration) (newLeader string, err error) { +func (vs *VolumeServer) doHeartbeat(masterNode, masterGrpcAddress string, grpcDialOption grpc.DialOption, sleepInterval time.Duration) (newLeader string, err error) { - grpcConection, err := util.GrpcDial(ctx, masterGrpcAddress, grpcDialOption) + grpcConection, err := util.GrpcDial(context.Background(), masterGrpcAddress, grpcDialOption) if err != nil { return "", fmt.Errorf("fail to dial %s : %v", masterNode, err) } defer grpcConection.Close() client := master_pb.NewSeaweedClient(grpcConection) - stream, err := client.SendHeartbeat(ctx) + stream, err := client.SendHeartbeat(context.Background()) if err != nil { glog.V(0).Infof("SendHeartbeat to %s: %v", masterNode, err) return "", err |
