From 21eb693629fe3450c4f8b02fc473fa2e99488c60 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Sat, 11 May 2024 09:25:08 +0800 Subject: [PATCH] etcd naming and discovery --- pkg/common/discoveryregister/discoveryregister.go | 4 +--- pkg/common/startrpc/start.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 0868e6f51..31bee9267 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -32,11 +32,9 @@ const ( ) // NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type. -func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry1, error) { - return getcd.NewSvcDiscoveryRegistry("openim", []string{"http://localhost:2379"}) +func NewDiscoveryRegister(zookeeperConfig *config.ZooKeeper, share *config.Share) (discovery.SvcDiscoveryRegistry, error) { switch share.Env { case zookeeperConst: - return zookeeper.NewZkClient( zookeeperConfig.Address, zookeeperConfig.Schema, diff --git a/pkg/common/startrpc/start.go b/pkg/common/startrpc/start.go index 1fdeec402..ebcd5aa7c 100644 --- a/pkg/common/startrpc/start.go +++ b/pkg/common/startrpc/start.go @@ -46,7 +46,7 @@ import ( // Start rpc server. func Start[T any](ctx context.Context, zookeeperConfig *config2.ZooKeeper, prometheusConfig *config2.Prometheus, listenIP, registerIP string, rpcPorts []int, index int, rpcRegisterName string, share *config2.Share, config T, rpcFn func(ctx context.Context, - config T, client discovery.SvcDiscoveryRegistry1, server *grpc.Server) error, options ...grpc.ServerOption) error { + config T, client discovery.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error { rpcPort, err := datautil.GetElemByIndex(rpcPorts, index) if err != nil {