mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-06 21:32:15 +08:00
feat: add code lint
This commit is contained in:
parent
318565acd8
commit
655add88bb
@ -15,8 +15,6 @@
|
||||
package discoveryregister
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/direct"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes"
|
||||
@ -28,10 +26,6 @@ import (
|
||||
// NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type.
|
||||
func NewDiscoveryRegister(config *config.GlobalConfig) (discovery.SvcDiscoveryRegistry, error) {
|
||||
|
||||
if os.Getenv("ENVS_DISCOVERY") != "" {
|
||||
config.Envs.Discovery = os.Getenv("ENVS_DISCOVERY")
|
||||
}
|
||||
|
||||
switch config.Envs.Discovery {
|
||||
case "zookeeper":
|
||||
return zookeeper.NewZookeeperDiscoveryRegister(&config.Zookeeper)
|
||||
|
||||
@ -104,6 +104,7 @@ func getSelfHost(ctx context.Context, gatewayName string) string {
|
||||
}
|
||||
|
||||
// like openimserver-openim-msggateway-0.openimserver-openim-msggateway-headless.openim-lin.svc.cluster.local:88.
|
||||
// Replica set in kubernetes environment
|
||||
func getMsgGatewayHost(ctx context.Context, gatewayName string) []string {
|
||||
port := 88
|
||||
instance := "openimserver"
|
||||
@ -189,9 +190,10 @@ func (cli *K8sDR) CloseConn(conn *grpc.ClientConn) {
|
||||
|
||||
// do not use this method for call rpc.
|
||||
func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn {
|
||||
fmt.Println("should not call this function!!!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
log.ZError(context.Background(), "should not call this function!", nil)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cli *K8sDR) Close() {
|
||||
|
||||
}
|
||||
|
||||
@ -20,9 +20,6 @@
|
||||
# READ: https://github.com/openimsdk/open-im-server/tree/main/scripts/install/environment.sh
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/install/common.sh"
|
||||
|
||||
@ -114,7 +111,3 @@ else
|
||||
openim::util::find_ports_for_all_services ${OPENIM_MSGTRANSFER_BINARY[@]}
|
||||
openim::log::success "All OpenIM services are running normally! "
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -94,7 +94,6 @@ if [[ $? -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
result=$(openim::util::check_process_names ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]})
|
||||
if [[ $? -ne 0 ]]; then
|
||||
openim::log::error "The OpenIM services may fail to start.\n $result"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user