From 0fe1c1efd8fe90fe9390f92649932ed4adbf1337 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Thu, 17 Nov 2022 20:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/rpc/rpc_client.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/internal/rpc/rpc_client.go b/internal/rpc/rpc_client.go index 37dcba6..d181738 100644 --- a/internal/rpc/rpc_client.go +++ b/internal/rpc/rpc_client.go @@ -27,9 +27,6 @@ type RPCClient struct { apiConfig *configs.APIConfig conns []*grpc.ClientConn - ctx context.Context - ctxUpdatedAt int64 - locker sync.RWMutex NodeRPC pb.NodeServiceClient @@ -97,12 +94,6 @@ func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) { // Context 节点上下文信息 func (this *RPCClient) Context() context.Context { - var currentTime = time.Now().Unix() - - if this.ctx != nil && this.ctxUpdatedAt > currentTime-5 { - return this.ctx - } - var m = maps.Map{ "timestamp": time.Now().Unix(), "type": "node", @@ -122,10 +113,6 @@ func (this *RPCClient) Context() context.Context { var ctx = context.Background() ctx = metadata.AppendToOutgoingContext(ctx, "nodeId", this.apiConfig.NodeId, "token", token) - - this.ctxUpdatedAt = currentTime - this.ctx = ctx - return ctx }