diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 053305f26..821c32aac 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -301,3 +301,8 @@ type notification struct { ConversationChanged NotificationConf `yaml:"conversationChanged"` ConversationSetPrivate NotificationConf `yaml:"conversationSetPrivate"` } + +func GetServiceNames() []string { + return []string{Config.RpcRegisterName.OpenImUserName, Config.RpcRegisterName.OpenImFriendName, Config.RpcRegisterName.OpenImMsgName, Config.RpcRegisterName.OpenImPushName, Config.RpcRegisterName.OpenImMessageGatewayName, + Config.RpcRegisterName.OpenImGroupName, Config.RpcRegisterName.OpenImAuthName, Config.RpcRegisterName.OpenImConversationName, Config.RpcRegisterName.OpenImThirdName} +} diff --git a/pkg/common/db/controller/msg_test.go b/pkg/common/db/controller/msg_test.go index e5bfe2e0d..8310d9d6a 100644 --- a/pkg/common/db/controller/msg_test.go +++ b/pkg/common/db/controller/msg_test.go @@ -19,9 +19,9 @@ import ( func Test_BatchInsertChat2DB(t *testing.T) { config.Config.Mongo.Address = []string{"192.168.44.128:37017"} - config.Config.Mongo.Timeout = 60 + // config.Config.Mongo.Timeout = 60 config.Config.Mongo.Database = "openIM" - config.Config.Mongo.Source = "admin" + // config.Config.Mongo.Source = "admin" config.Config.Mongo.Username = "root" config.Config.Mongo.Password = "openIM123" config.Config.Mongo.MaxPoolSize = 100 @@ -130,9 +130,9 @@ func Test_BatchInsertChat2DB(t *testing.T) { func GetDB() *commonMsgDatabase { config.Config.Mongo.Address = []string{"192.168.44.128:37017"} - config.Config.Mongo.Timeout = 60 + // config.Config.Mongo.Timeout = 60 config.Config.Mongo.Database = "openIM" - config.Config.Mongo.Source = "admin" + // config.Config.Mongo.Source = "admin" config.Config.Mongo.Username = "root" config.Config.Mongo.Password = "openIM123" config.Config.Mongo.MaxPoolSize = 100 diff --git a/pkg/common/mw/check_test.go b/pkg/common/mw/check_test.go index 88845af1b..091942550 100644 --- a/pkg/common/mw/check_test.go +++ b/pkg/common/mw/check_test.go @@ -2,12 +2,11 @@ package mw import ( "fmt" - "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config" "testing" ) func TestCheck(t *testing.T) { - config.Config.TokenPolicy.Secret = "123456" + // config.Config.TokenPolicy.Secret = "123456" args := []string{"1", "2", "3"}