From 2a0df3a22e4324c10a840c59563b7cdb14d5bfc9 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Fri, 24 Oct 2025 14:56:05 +0800 Subject: [PATCH] fix: incorrect redis fields. (#3602) * Fix: Resolved the issue of incorrect generation of conversationID in 3.8.3-patch branch. * fix: solve incorrect time.Unix and logger asyncwrite in 3.8.3-patch branch. * fix: incorrect redis fields. --- config/redis.yml | 3 ++- go.mod | 2 +- go.sum | 4 ++-- pkg/common/config/config.go | 28 ++++++++++++++-------------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/config/redis.yml b/config/redis.yml index 2448bcb5c..60579bbd2 100644 --- a/config/redis.yml +++ b/config/redis.yml @@ -1,7 +1,8 @@ address: [ localhost:16379 ] username: password: openIM123 -clusterMode: false +# redisMode can be "cluster", "sentinel", or "standalone" +redisMode: "standalone" db: 0 maxRetry: 10 poolSize: 100 diff --git a/go.mod b/go.mod index 89f361d40..66f2ee399 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/mitchellh/mapstructure v1.5.0 github.com/openimsdk/protocol v0.0.73-alpha.12 - github.com/openimsdk/tools v0.0.50-alpha.103 + github.com/openimsdk/tools v0.0.50-alpha.106 github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.18.0 github.com/stretchr/testify v1.10.0 diff --git a/go.sum b/go.sum index 557c1870d..3037b0010 100644 --- a/go.sum +++ b/go.sum @@ -349,8 +349,8 @@ github.com/openimsdk/gomake v0.0.15-alpha.5 h1:eEZCEHm+NsmcO3onXZPIUbGFCYPYbsX5b github.com/openimsdk/gomake v0.0.15-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= github.com/openimsdk/protocol v0.0.73-alpha.12 h1:2NYawXeHChYUeSme6QJ9pOLh+Empce2WmwEtbP4JvKk= github.com/openimsdk/protocol v0.0.73-alpha.12/go.mod h1:WF7EuE55vQvpyUAzDXcqg+B+446xQyEba0X35lTINmw= -github.com/openimsdk/tools v0.0.50-alpha.103 h1:jYvI86cWiVu8a8iw1panw+pwIiStuUHF76h3fxA6ESI= -github.com/openimsdk/tools v0.0.50-alpha.103/go.mod h1:qCExFBqXpQBMzZck3XGIFwivBayAn2KNqB3WAd++IJw= +github.com/openimsdk/tools v0.0.50-alpha.106 h1:gaqU08IbRxOdL16ZEQNyYLhCTf7K1HNkrik8KZLA+BM= +github.com/openimsdk/tools v0.0.50-alpha.106/go.mod h1:x9i/e+WJFW4tocy6RNJQ9NofQiP3KJ1Y576/06TqOG4= 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/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index f5ff8f9bb..4cd202db4 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -354,13 +354,13 @@ type User struct { } type Redis struct { - Address []string `mapstructure:"address"` - Username string `mapstructure:"username"` - Password string `mapstructure:"password"` - ClusterMode bool `mapstructure:"clusterMode"` - DB int `mapstructure:"db"` - MaxRetry int `mapstructure:"maxRetry"` - PoolSize int `mapstructure:"poolSize"` + Address []string `mapstructure:"address"` + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` + RedisMode string `mapstructure:"redisMode"` + DB int `mapstructure:"db"` + MaxRetry int `mapstructure:"maxRetry"` + PoolSize int `mapstructure:"poolSize"` } type BeforeConfig struct { @@ -511,13 +511,13 @@ func (m *Mongo) Build() *mongoutil.Config { func (r *Redis) Build() *redisutil.Config { return &redisutil.Config{ - ClusterMode: r.ClusterMode, - Address: r.Address, - Username: r.Username, - Password: r.Password, - DB: r.DB, - MaxRetry: r.MaxRetry, - PoolSize: r.PoolSize, + RedisMode: r.RedisMode, + Address: r.Address, + Username: r.Username, + Password: r.Password, + DB: r.DB, + MaxRetry: r.MaxRetry, + PoolSize: r.PoolSize, } }