This commit is contained in:
wangchuxiao
2023-03-09 14:59:45 +08:00
parent 82f499f942
commit ae2e09e48b
3 changed files with 16 additions and 14 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ import (
"net"
)
func start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options []grpc.ServerOption) error {
func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
fmt.Println("start", rpcRegisterName, "rpc server, port: ", rpcPort, "prometheusPort:", prometheusPort, ", OpenIM version: ", config.Version)
log.NewPrivateLog(constant.LogFileName)
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", config.Config.ListenIP, rpcPort))
@@ -60,6 +60,6 @@ func start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(c
return rpcFn(zkClient, srv)
}
func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
return start(rpcPort, rpcRegisterName, prometheusPort, rpcFn, options)
}
//func Start(rpcPort int, rpcRegisterName string, prometheusPort int, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error, options ...grpc.ServerOption) error {
// return start(rpcPort, rpcRegisterName, prometheusPort, rpcFn, options)
//}