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) + } } } }