上传用户离线通知日志服务器处理数据同步

This commit is contained in:
liwei1dao 2022-07-22 16:21:31 +08:00
parent ef9f36f3ee
commit 999c7f3c41
2 changed files with 13 additions and 1 deletions

View File

@ -17,7 +17,7 @@ const (
const (
Service_Gateway = "gateway"
Service_Worker = "worker"
Service_DB = "dbservice"
Service_Mainte = "mainte"
)
//ERR

View File

@ -53,6 +53,18 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
}, reply); err != nil {
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
}
//通知运维服务器 处理用户离线数据同步
if _, err := this.service.RpcGo(context.Background(), comm.Service_Mainte, 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 _, err := this.service.AcrossClusterRpcGo(context.Background(), this.options.SpanServiceTag, comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{
Ip: a.IP(),