mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-10-26 21:22:16 +08:00 
			
		
		
		
	drop useless code
This commit is contained in:
		
							parent
							
								
									0af9b09b75
								
							
						
					
					
						commit
						4afc47101e
					
				| @ -55,7 +55,6 @@ func (s *Server) Start(ctx context.Context, index int, conf *Config) error { | ||||
| } | ||||
| 
 | ||||
| type Server struct { | ||||
| 	rpcPort        int | ||||
| 	LongConnServer LongConnServer | ||||
| 	config         *Config | ||||
| 	pushTerminal   map[int]struct{} | ||||
| @ -68,9 +67,8 @@ func (s *Server) SetLongConnServer(LongConnServer LongConnServer) { | ||||
| 	s.LongConnServer = LongConnServer | ||||
| } | ||||
| 
 | ||||
| func NewServer(rpcPort int, longConnServer LongConnServer, conf *Config, ready func(srv *Server) error) *Server { | ||||
| func NewServer(longConnServer LongConnServer, conf *Config, ready func(srv *Server) error) *Server { | ||||
| 	s := &Server{ | ||||
| 		rpcPort:        rpcPort, | ||||
| 		LongConnServer: longConnServer, | ||||
| 		pushTerminal:   make(map[int]struct{}), | ||||
| 		config:         conf, | ||||
|  | ||||
| @ -35,16 +35,13 @@ type Config struct { | ||||
| 
 | ||||
| // Start run ws server. | ||||
| func Start(ctx context.Context, index int, conf *Config) error { | ||||
| 	log.CInfo(ctx, "MSG-GATEWAY server is initializing", "rpcPorts", conf.MsgGateway.RPC.Ports, | ||||
| 	log.CInfo(ctx, "MSG-GATEWAY server is initializing", | ||||
| 		"wsPort", conf.MsgGateway.LongConnSvr.Ports, "prometheusPorts", conf.MsgGateway.Prometheus.Ports) | ||||
| 	wsPort, err := datautil.GetElemByIndex(conf.MsgGateway.LongConnSvr.Ports, index) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	rpcPort, err := datautil.GetElemByIndex(conf.MsgGateway.RPC.Ports, index) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 
 | ||||
| 	rdb, err := redisutil.NewRedisClient(ctx, conf.RedisConfig.Build()) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| @ -57,7 +54,7 @@ func Start(ctx context.Context, index int, conf *Config) error { | ||||
| 		WithMessageMaxMsgLength(conf.MsgGateway.LongConnSvr.WebsocketMaxMsgLen), | ||||
| 	) | ||||
| 
 | ||||
| 	hubServer := NewServer(rpcPort, longServer, conf, func(srv *Server) error { | ||||
| 	hubServer := NewServer(longServer, conf, func(srv *Server) error { | ||||
| 		longServer.online, _ = rpccache.NewOnlineCache(srv.userRcp, nil, rdb, false, longServer.subscriberUserOnlineStatusChanges) | ||||
| 		return nil | ||||
| 	}) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user