mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 19:32:17 +08:00 
			
		
		
		
	Add etcd as a service discovery mechanism
This commit is contained in:
		
							parent
							
								
									c8f3457385
								
							
						
					
					
						commit
						f98ce222e0
					
				@ -211,6 +211,7 @@ func (ws *WsServer) sendUserOnlineInfoToOtherNode(ctx context.Context, client *C
 | 
			
		||||
 | 
			
		||||
	// Online push user online message to other node
 | 
			
		||||
	for _, v := range conns {
 | 
			
		||||
		v := v
 | 
			
		||||
		log.ZDebug(ctx, " sendUserOnlineInfoToOtherNode conn ", "target", v.Target())
 | 
			
		||||
		if v.Target() == ws.disCov.GetSelfConnTarget() {
 | 
			
		||||
			log.ZDebug(ctx, "Filter out this node", "node", v.Target())
 | 
			
		||||
 | 
			
		||||
@ -81,6 +81,7 @@ func (d *DefaultAllNode) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.M
 | 
			
		||||
 | 
			
		||||
	// Online push message
 | 
			
		||||
	for _, conn := range conns {
 | 
			
		||||
		log.ZDebug(ctx, "get gateway conn detail ", "conn ", *conn)
 | 
			
		||||
		conn := conn // loop var safe
 | 
			
		||||
		wg.Go(func() error {
 | 
			
		||||
			msgClient := msggateway.NewMsgGatewayClient(conn)
 | 
			
		||||
 | 
			
		||||
@ -107,8 +107,9 @@ func (r *SvcDiscoveryRegistryImpl) GetConns(ctx context.Context, serviceName str
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
		conns = append(conns, conn)
 | 
			
		||||
		fmt.Println("GetConns detail ", *conn)
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	fmt.Println("GetConns number ", len(conns))
 | 
			
		||||
	return conns, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user