Add etcd as a service discovery mechanism

This commit is contained in:
skiffer-git 2024-05-14 11:35:52 +08:00
parent 22a07a88f1
commit adb716424c

View File

@ -61,7 +61,12 @@ func NewDefaultAllNode(disCov discovery.SvcDiscoveryRegistry, config *Config) *D
func (d *DefaultAllNode) GetConnsAndOnlinePush(ctx context.Context, msg *sdkws.MsgData,
pushToUserIDs []string) (wsResults []*msggateway.SingleMsgToUserResults, err error) {
conns, err := d.disCov.GetConns(ctx, d.config.Share.RpcRegisterName.MessageGateway)
log.ZDebug(ctx, "get gateway conn", "conn length", len(conns))
if len(conns) == 0 {
log.ZWarn(ctx, "get gateway conn 0 ", nil)
} else {
log.ZDebug(ctx, "get gateway conn", "conn length", len(conns))
}
if err != nil {
return nil, err
}