feat: add code lint

pull/2148/head
Xinwei Xiong (cubxxw) 2 years ago
parent 318565acd8
commit 655add88bb

@ -15,8 +15,6 @@
package discoveryregister package discoveryregister
import ( import (
"os"
"github.com/openimsdk/open-im-server/v3/pkg/common/config" "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/direct"
"github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes" "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. // NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type.
func NewDiscoveryRegister(config *config.GlobalConfig) (discovery.SvcDiscoveryRegistry, error) { func NewDiscoveryRegister(config *config.GlobalConfig) (discovery.SvcDiscoveryRegistry, error) {
if os.Getenv("ENVS_DISCOVERY") != "" {
config.Envs.Discovery = os.Getenv("ENVS_DISCOVERY")
}
switch config.Envs.Discovery { switch config.Envs.Discovery {
case "zookeeper": case "zookeeper":
return zookeeper.NewZookeeperDiscoveryRegister(&config.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. // 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 { func getMsgGatewayHost(ctx context.Context, gatewayName string) []string {
port := 88 port := 88
instance := "openimserver" instance := "openimserver"
@ -189,9 +190,10 @@ func (cli *K8sDR) CloseConn(conn *grpc.ClientConn) {
// do not use this method for call rpc. // do not use this method for call rpc.
func (cli *K8sDR) GetClientLocalConns() map[string][]*grpc.ClientConn { 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 return nil
} }
func (cli *K8sDR) Close() { func (cli *K8sDR) Close() {
} }

@ -20,9 +20,6 @@
# READ: https://github.com/openimsdk/open-im-server/tree/main/scripts/install/environment.sh # READ: https://github.com/openimsdk/open-im-server/tree/main/scripts/install/environment.sh
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${OPENIM_ROOT}/scripts/install/common.sh" source "${OPENIM_ROOT}/scripts/install/common.sh"
@ -114,7 +111,3 @@ else
openim::util::find_ports_for_all_services ${OPENIM_MSGTRANSFER_BINARY[@]} openim::util::find_ports_for_all_services ${OPENIM_MSGTRANSFER_BINARY[@]}
openim::log::success "All OpenIM services are running normally! " openim::log::success "All OpenIM services are running normally! "
fi fi

@ -94,7 +94,6 @@ if [[ $? -ne 0 ]]; then
exit 1 exit 1
fi fi
result=$(openim::util::check_process_names ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]}) result=$(openim::util::check_process_names ${OPENIM_ALL_SERVICE_LIBRARIES_NO_TRANSFER[@]})
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
openim::log::error "The OpenIM services may fail to start.\n $result" openim::log::error "The OpenIM services may fail to start.\n $result"

Loading…
Cancel
Save