mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-10 03:56:00 +08:00
superGroupMaxSeq
This commit is contained in:
@@ -196,6 +196,10 @@ type config struct {
|
||||
Intent string `yaml:"intent"`
|
||||
MasterSecret string `yaml:"masterSecret"`
|
||||
}
|
||||
Fcm struct {
|
||||
ServiceAccount string `yaml:"serviceAccount"`
|
||||
Enable bool `yaml:"enable"`
|
||||
}
|
||||
}
|
||||
Manager struct {
|
||||
AppManagerUid []string `yaml:"appManagerUid"`
|
||||
|
||||
@@ -31,6 +31,7 @@ const (
|
||||
SignalCache = "SIGNAL_CACHE:"
|
||||
SignalListCache = "SIGNAL_LIST_CACHE:"
|
||||
GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT"
|
||||
FcmToken = "FCM_TOKEN:"
|
||||
groupUserMinSeq = "GROUP_USER_MIN_SEQ:"
|
||||
groupMaxSeq = "GROUP_MAX_SEQ"
|
||||
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG"
|
||||
@@ -373,3 +374,13 @@ func (d *DataBases) SetSendMsgFailedFlag(operationID string) error {
|
||||
func (d *DataBases) GetSendMsgStatus(operationID string) error {
|
||||
return d.RDB.Get(context.Background(), sendMsgFailedFlag+operationID).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) SetFcmToken(account string, platformid int, fcmToken string, expireTime int64) (err error) {
|
||||
key := FcmToken + account + ":" + strconv.Itoa(platformid)
|
||||
return d.RDB.Set(context.Background(), key, fcmToken, time.Duration(expireTime)*time.Second).Err()
|
||||
}
|
||||
|
||||
func (d *DataBases) GetFcmToken(account string, platformid int) (string, error) {
|
||||
key := FcmToken + account + ":" + strconv.Itoa(platformid)
|
||||
return d.RDB.Get(context.Background(), key).Result()
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ type RedisClient struct {
|
||||
client *go_redis.Client
|
||||
cluster *go_redis.ClusterClient
|
||||
go_redis.UniversalClient
|
||||
enableCluster bool
|
||||
}
|
||||
|
||||
func key(dbAddress, dbName string) string {
|
||||
@@ -58,10 +59,10 @@ func init() {
|
||||
uri = config.Config.Mongo.DBUri
|
||||
} else {
|
||||
if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" {
|
||||
uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress,
|
||||
uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d&authSource=admin", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress,
|
||||
config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize)
|
||||
} else {
|
||||
uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d",
|
||||
uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d&authSource=admin",
|
||||
config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase,
|
||||
config.Config.Mongo.DBMaxPoolSize)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user