From 6052a984b09608e7cdca64bbc9cc2ebcb40fcb2c Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 22 Jul 2022 16:36:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=A6=BB=E7=BA=BF=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E8=B7=A8=E6=9C=8D=E9=9B=86=E7=BE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agentmgr_comp.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/gateway/agentmgr_comp.go b/modules/gateway/agentmgr_comp.go index 4815168de..24e2e7fb8 100644 --- a/modules/gateway/agentmgr_comp.go +++ b/modules/gateway/agentmgr_comp.go @@ -64,16 +64,17 @@ func (this *AgentMgrComp) DisConnect(a IAgent) { }, reply); err != nil { log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err) } - - //推送跨服集群处理 - if _, err := this.service.AcrossClusterRpcGo(context.Background(), this.options.SpanServiceTag, comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{ - Ip: a.IP(), - ServiceTag: this.service.GetTag(), - GatewayServiceId: this.service.GetId(), - UserSessionId: a.SessionId(), - UserId: a.UserId(), - }, reply); err != nil { - log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err) + if this.options.SpanServiceTag != "" { + //推送跨服集群处理 + if _, err := this.service.AcrossClusterRpcGo(context.Background(), this.options.SpanServiceTag, comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{ + Ip: a.IP(), + ServiceTag: this.service.GetTag(), + GatewayServiceId: this.service.GetId(), + UserSessionId: a.SessionId(), + UserId: a.UserId(), + }, reply); err != nil { + log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err) + } } } }