mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-03 01:52:17 +08:00
feat: add rocksTimeout
This commit is contained in:
parent
2477a6658c
commit
8af9dcb99c
@ -28,6 +28,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
rocksCacheTimeout = 11 * time.Second
|
||||||
|
)
|
||||||
|
|
||||||
// BatchDeleterRedis is a concrete implementation of the BatchDeleter interface based on Redis and RocksCache.
|
// BatchDeleterRedis is a concrete implementation of the BatchDeleter interface based on Redis and RocksCache.
|
||||||
type BatchDeleterRedis struct {
|
type BatchDeleterRedis struct {
|
||||||
redisClient redis.UniversalClient
|
redisClient redis.UniversalClient
|
||||||
@ -106,6 +110,8 @@ func (c *BatchDeleterRedis) AddKeys(keys ...string) {
|
|||||||
// GetRocksCacheOptions returns the default configuration options for RocksCache.
|
// GetRocksCacheOptions returns the default configuration options for RocksCache.
|
||||||
func GetRocksCacheOptions() *rockscache.Options {
|
func GetRocksCacheOptions() *rockscache.Options {
|
||||||
opts := rockscache.NewDefaultOptions()
|
opts := rockscache.NewDefaultOptions()
|
||||||
|
opts.LockExpire = rocksCacheTimeout
|
||||||
|
opts.WaitReplicasTimeout = rocksCacheTimeout
|
||||||
opts.StrongConsistency = true
|
opts.StrongConsistency = true
|
||||||
opts.RandomExpireAdjustment = 0.2
|
opts.RandomExpireAdjustment = 0.2
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user