mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-10-26 21:22:16 +08:00 
			
		
		
		
	Merge pull request #3133 from withchao/pre-release-v3.8.4
fix: pre-release-v3.8.4 startup error caused by merging
This commit is contained in:
		
						commit
						7286a7f66d
					
				| @ -1,12 +1,10 @@ | |||||||
| groupCreated: | groupCreated: | ||||||
|   isSendMsg: true |   isSendMsg: true | ||||||
| # Reliability level of the message sending. |   # Deprecated. Fixed as 1. | ||||||
| # Set to 1 to send only when online, 2 for guaranteed delivery. |  | ||||||
|   reliabilityLevel: 1 |   reliabilityLevel: 1 | ||||||
| # This setting is effective only when 'isSendMsg' is true. |   # Deprecated. Fixed as false. | ||||||
| # It controls whether to count unread messages. |  | ||||||
|   unreadCount: false |   unreadCount: false | ||||||
| # Configuration for offline push notifications. |   # Configuration for offline push notifications. | ||||||
|   offlinePush: |   offlinePush: | ||||||
|     # Enables or disables offline push notifications. |     # Enables or disables offline push notifications. | ||||||
|     enable: false |     enable: false | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| @ -13,7 +13,7 @@ require ( | |||||||
| 	github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 | 	github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 | ||||||
| 	github.com/mitchellh/mapstructure v1.5.0 | 	github.com/mitchellh/mapstructure v1.5.0 | ||||||
| 	github.com/openimsdk/protocol v0.0.72-alpha.71 | 	github.com/openimsdk/protocol v0.0.72-alpha.71 | ||||||
| 	github.com/openimsdk/tools v0.0.50-alpha.71 | 	github.com/openimsdk/tools v0.0.50-alpha.72 | ||||||
| 	github.com/pkg/errors v0.9.1 // indirect | 	github.com/pkg/errors v0.9.1 // indirect | ||||||
| 	github.com/prometheus/client_golang v1.18.0 | 	github.com/prometheus/client_golang v1.18.0 | ||||||
| 	github.com/stretchr/testify v1.9.0 | 	github.com/stretchr/testify v1.9.0 | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								go.sum
									
									
									
									
									
								
							| @ -349,8 +349,8 @@ github.com/openimsdk/gomake v0.0.14-alpha.5 h1:VY9c5x515lTfmdhhPjMvR3BBRrRquAUCF | |||||||
| github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= | github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= | ||||||
| github.com/openimsdk/protocol v0.0.72-alpha.71 h1:R3utzOlqepaJWTAmnfJi4ccUM/XIoFasSyjQMOipM70= | github.com/openimsdk/protocol v0.0.72-alpha.71 h1:R3utzOlqepaJWTAmnfJi4ccUM/XIoFasSyjQMOipM70= | ||||||
| github.com/openimsdk/protocol v0.0.72-alpha.71/go.mod h1:WF7EuE55vQvpyUAzDXcqg+B+446xQyEba0X35lTINmw= | github.com/openimsdk/protocol v0.0.72-alpha.71/go.mod h1:WF7EuE55vQvpyUAzDXcqg+B+446xQyEba0X35lTINmw= | ||||||
| github.com/openimsdk/tools v0.0.50-alpha.71 h1:QsjhJSqPnIy3ai6Xh2ic3xW8WtjBJlg5gK+d8qhXnck= | github.com/openimsdk/tools v0.0.50-alpha.72 h1:d/vaZjIfvrNp3EeRJEIiamBO7HiPx6CP4wiuq8NpfzY= | ||||||
| github.com/openimsdk/tools v0.0.50-alpha.71/go.mod h1:B+oqV0zdewN7OiEHYJm+hW+8/Te7B8tHHgD8rK5ZLZk= | github.com/openimsdk/tools v0.0.50-alpha.72/go.mod h1:B+oqV0zdewN7OiEHYJm+hW+8/Te7B8tHHgD8rK5ZLZk= | ||||||
| github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= | github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= | ||||||
| github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= | github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= | ||||||
| github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= | github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= | ||||||
|  | |||||||
| @ -391,11 +391,3 @@ func (m *MessageApi) SearchMsg(c *gin.Context) { | |||||||
| func (m *MessageApi) GetServerTime(c *gin.Context) { | func (m *MessageApi) GetServerTime(c *gin.Context) { | ||||||
| 	a2r.Call(c, msg.MsgClient.GetServerTime, m.Client) | 	a2r.Call(c, msg.MsgClient.GetServerTime, m.Client) | ||||||
| } | } | ||||||
| 
 |  | ||||||
| func (m *MessageApi) GetStreamMsg(c *gin.Context) { |  | ||||||
| 	a2r.Call(c, msg.MsgClient.GetServerTime, m.Client) |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| func (m *MessageApi) AppendStreamMsg(c *gin.Context) { |  | ||||||
| 	a2r.Call(c, msg.MsgClient.GetServerTime, m.Client) |  | ||||||
| } |  | ||||||
|  | |||||||
| @ -246,8 +246,6 @@ func newGinRouter(ctx context.Context, client discovery.SvcDiscoveryRegistry, cf | |||||||
| 		msgGroup.POST("/batch_send_msg", m.BatchSendMsg) | 		msgGroup.POST("/batch_send_msg", m.BatchSendMsg) | ||||||
| 		msgGroup.POST("/check_msg_is_send_success", m.CheckMsgIsSendSuccess) | 		msgGroup.POST("/check_msg_is_send_success", m.CheckMsgIsSendSuccess) | ||||||
| 		msgGroup.POST("/get_server_time", m.GetServerTime) | 		msgGroup.POST("/get_server_time", m.GetServerTime) | ||||||
| 		msgGroup.POST("/get_stream_msg", m.GetStreamMsg) |  | ||||||
| 		msgGroup.POST("/append_stream_msg", m.AppendStreamMsg) |  | ||||||
| 	} | 	} | ||||||
| 	// Conversation | 	// Conversation | ||||||
| 	{ | 	{ | ||||||
|  | |||||||
| @ -1,63 +0,0 @@ | |||||||
| package tools |  | ||||||
| 
 |  | ||||||
| import ( |  | ||||||
| 	"context" |  | ||||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/config" |  | ||||||
| 	kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" |  | ||||||
| 	pbconversation "github.com/openimsdk/protocol/conversation" |  | ||||||
| 	"github.com/openimsdk/protocol/msg" |  | ||||||
| 	"github.com/openimsdk/protocol/third" |  | ||||||
| 	"github.com/openimsdk/tools/mcontext" |  | ||||||
| 	"github.com/openimsdk/tools/mw" |  | ||||||
| 	"github.com/robfig/cron/v3" |  | ||||||
| 	"google.golang.org/grpc" |  | ||||||
| 	"google.golang.org/grpc/credentials/insecure" |  | ||||||
| 	"testing" |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| func TestName(t *testing.T) { |  | ||||||
| 	conf := &config.Discovery{ |  | ||||||
| 		Enable: config.ETCD, |  | ||||||
| 		Etcd: config.Etcd{ |  | ||||||
| 			RootDirectory: "openim", |  | ||||||
| 			Address:       []string{"localhost:12379"}, |  | ||||||
| 		}, |  | ||||||
| 	} |  | ||||||
| 	client, err := kdisc.NewDiscoveryRegister(conf, "source") |  | ||||||
| 	if err != nil { |  | ||||||
| 		panic(err) |  | ||||||
| 	} |  | ||||||
| 	client.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials())) |  | ||||||
| 	ctx := mcontext.SetOpUserID(context.Background(), "imAdmin") |  | ||||||
| 	msgConn, err := client.GetConn(ctx, "msg-rpc-service") |  | ||||||
| 	if err != nil { |  | ||||||
| 		panic(err) |  | ||||||
| 	} |  | ||||||
| 	thirdConn, err := client.GetConn(ctx, "third-rpc-service") |  | ||||||
| 	if err != nil { |  | ||||||
| 		panic(err) |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	conversationConn, err := client.GetConn(ctx, "conversation-rpc-service") |  | ||||||
| 	if err != nil { |  | ||||||
| 		panic(err) |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	srv := &cronServer{ |  | ||||||
| 		ctx: ctx, |  | ||||||
| 		config: &CronTaskConfig{ |  | ||||||
| 			CronTask: config.CronTask{ |  | ||||||
| 				RetainChatRecords: 1, |  | ||||||
| 				FileExpireTime:    1, |  | ||||||
| 				DeleteObjectType:  []string{"msg-picture", "msg-file", "msg-voice", "msg-video", "msg-video-snapshot", "sdklog", ""}, |  | ||||||
| 			}, |  | ||||||
| 		}, |  | ||||||
| 		cron:               cron.New(), |  | ||||||
| 		msgClient:          msg.NewMsgClient(msgConn), |  | ||||||
| 		conversationClient: pbconversation.NewConversationClient(conversationConn), |  | ||||||
| 		thirdClient:        third.NewThirdClient(thirdConn), |  | ||||||
| 	} |  | ||||||
| 	srv.deleteMsg() |  | ||||||
| 	//srv.clearS3() |  | ||||||
| 	//srv.clearUserMsg() |  | ||||||
| } |  | ||||||
| @ -635,7 +635,7 @@ func (l *CacheConfig) Enable() bool { | |||||||
| 	return l.Topic != "" && l.SlotNum > 0 && l.SlotSize > 0 | 	return l.Topic != "" && l.SlotNum > 0 && l.SlotSize > 0 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| var ( | const ( | ||||||
| 	DiscoveryConfigFilename          = "discovery.yml" | 	DiscoveryConfigFilename          = "discovery.yml" | ||||||
| 	KafkaConfigFileName              = "kafka.yml" | 	KafkaConfigFileName              = "kafka.yml" | ||||||
| 	LocalCacheConfigFileName         = "local-cache.yml" | 	LocalCacheConfigFileName         = "local-cache.yml" | ||||||
| @ -657,6 +657,7 @@ var ( | |||||||
| 	RedisConfigFileName              = "redis.yml" | 	RedisConfigFileName              = "redis.yml" | ||||||
| 	ShareFileName                    = "share.yml" | 	ShareFileName                    = "share.yml" | ||||||
| 	WebhooksConfigFileName           = "webhooks.yml" | 	WebhooksConfigFileName           = "webhooks.yml" | ||||||
|  | 	NotificationFileName             = "notification.yml" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func (d *Discovery) GetConfigFileName() string { | func (d *Discovery) GetConfigFileName() string { | ||||||
|  | |||||||
| @ -27,8 +27,6 @@ import ( | |||||||
| 
 | 
 | ||||||
| const ( | const ( | ||||||
| 	FileName = "config.yaml" | 	FileName = "config.yaml" | ||||||
| 	NotificationFileName = "notification.yaml" |  | ||||||
| 	DefaultFolderPath    = "../config/" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| // return absolude path join ../config/, this is k8s container config path. | // return absolude path join ../config/, this is k8s container config path. | ||||||
|  | |||||||
| @ -20,6 +20,7 @@ import ( | |||||||
| 	"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" | 	"github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" | ||||||
| 	"github.com/openimsdk/tools/db/mongoutil" | 	"github.com/openimsdk/tools/db/mongoutil" | ||||||
| 	"github.com/openimsdk/tools/db/redisutil" | 	"github.com/openimsdk/tools/db/redisutil" | ||||||
|  | 	"github.com/openimsdk/tools/utils/runtimeenv" | ||||||
| 	"github.com/redis/go-redis/v9" | 	"github.com/redis/go-redis/v9" | ||||||
| 	"github.com/spf13/viper" | 	"github.com/spf13/viper" | ||||||
| 	"go.mongodb.org/mongo-driver/bson" | 	"go.mongodb.org/mongo-driver/bson" | ||||||
| @ -64,11 +65,11 @@ func readConfig[T any](dir string, name string) (*T, error) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func Main(conf string, del time.Duration) error { | func Main(conf string, del time.Duration) error { | ||||||
| 	redisConfig, err := readConfig[config.Redis](conf, cmd.RedisConfigFileName) | 	redisConfig, err := readConfig[config.Redis](conf, config.RedisConfigFileName) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	mongodbConfig, err := readConfig[config.Mongo](conf, cmd.MongodbConfigFileName) | 	mongodbConfig, err := readConfig[config.Mongo](conf, config.MongodbConfigFileName) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user