mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-04 19:32:17 +08:00
fix: msg cache timeout.
This commit is contained in:
parent
51bb55585f
commit
7969f56d44
@ -1,5 +1,3 @@
|
||||
prometheus:
|
||||
enable: true
|
||||
ports: [ 20108, 20109, 20110, 20111 ]
|
||||
|
||||
msgCacheTimeout: 86400
|
||||
@ -88,7 +88,7 @@ func Start(ctx context.Context, index int, config *Config) error {
|
||||
client.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, "round_robin")))
|
||||
//todo MsgCacheTimeout
|
||||
msgModel := cache.NewMsgCache(rdb, 86400, config.RedisConfig.EnablePipeline)
|
||||
msgModel := cache.NewMsgCache(rdb, config.RedisConfig.EnablePipeline)
|
||||
seqModel := cache.NewSeqCache(rdb)
|
||||
msgDocModel, err := mgo.NewMsgMongo(mgocli.GetDB())
|
||||
if err != nil {
|
||||
|
||||
@ -86,7 +86,7 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
|
||||
return err
|
||||
}
|
||||
//todo MsgCacheTimeout
|
||||
msgModel := cache.NewMsgCache(rdb, 86400, config.RedisConfig.EnablePipeline)
|
||||
msgModel := cache.NewMsgCache(rdb, config.RedisConfig.EnablePipeline)
|
||||
seqModel := cache.NewSeqCache(rdb)
|
||||
conversationClient := rpcclient.NewConversationRpcClient(client, config.Share.RpcRegisterName.Conversation)
|
||||
userRpcClient := rpcclient.NewUserRpcClient(client, config.Share.RpcRegisterName.User, config.Share.IMAdminUserID)
|
||||
|
||||
@ -185,8 +185,7 @@ type MsgGateway struct {
|
||||
}
|
||||
|
||||
type MsgTransfer struct {
|
||||
Prometheus Prometheus `mapstructure:"prometheus"`
|
||||
MsgCacheTimeout int `mapstructure:"msgCacheTimeout"`
|
||||
Prometheus Prometheus `mapstructure:"prometheus"`
|
||||
}
|
||||
|
||||
type Push struct {
|
||||
|
||||
4
pkg/common/db/cache/msg.go
vendored
4
pkg/common/db/cache/msg.go
vendored
@ -31,6 +31,8 @@ import (
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
const msgCacheTimeout = 86400
|
||||
|
||||
const (
|
||||
maxSeq = "MAX_SEQ:"
|
||||
minSeq = "MIN_SEQ:"
|
||||
@ -82,7 +84,7 @@ type MsgCache interface {
|
||||
// return &msgCache{rdb: client, msgCacheTimeout: msgCacheTimeout, redisConf: redisConf}
|
||||
//}
|
||||
|
||||
func NewMsgCache(client redis.UniversalClient, msgCacheTimeout time.Duration, redisEnablePipeline bool) MsgCache {
|
||||
func NewMsgCache(client redis.UniversalClient, redisEnablePipeline bool) MsgCache {
|
||||
return &msgCache{rdb: client, msgCacheTimeout: msgCacheTimeout, redisEnablePipeline: redisEnablePipeline}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user